diff --git a/petitions/utils.py b/petitions/utils.py new file mode 100644 index 0000000000000000000000000000000000000000..afce465c6add653a0efc2e00526a42d1e368e229 --- /dev/null +++ b/petitions/utils.py @@ -0,0 +1,26 @@ +from common.utils import BaseMailUtil + + +SPB_PETITION_THANKS = ( + 'Many thanks for signing the petition!\n\n' + 'If you have not done so already, you can really further help SciPost convince ' + 'your institution, library and/or funding agency to become Supporting Partners ' + 'by sending a personalized email to one of their representatives; we have a ' + 'handy email template for you to use at https://scipost.org/partners/.\n\n' + 'You can also point them to our prospectus and draft agreement on that same ' + 'page.\n\nWe are very grateful for your help.\n\nThe SciPost Team' + ) + +SPB_PETITION_THANKS_HTML = ( +) + + +class PetitionUtils(BaseMailUtil): + mail_sender = 'petitions@scipost.org' + mail_sender_title = 'SciPost petitions' + + @classmethod + def send_SPB_petition_signature_thanks(cls, email_address): + cls._send_mail(cls, 'SPB_petition_signature_thanks', + [email_address], + 'Thanks for signing') diff --git a/petitions/views.py b/petitions/views.py index 7caab2ca1571b95c1d31f420e1b8fb1763d6ac1c..b702d80784f700c223fe6be5da4f6228a3955790 100644 --- a/petitions/views.py +++ b/petitions/views.py @@ -9,6 +9,7 @@ from django.template import Context, Template from .models import Petition, PetitionSignatory from .forms import SignPetitionForm +from .utils import PetitionUtils def petition(request, slug): @@ -39,6 +40,8 @@ def petition(request, slug): if request.user.is_authenticated: signature.signatory = request.user.contributor signature.verified = True + PetitionUtils.load({'petition': petition}) + PetitionUtils.send_SPB_petition_signature_thanks(request.user.email) else: # Generate verification key and link salt = "" @@ -96,4 +99,6 @@ def verify_signature(request, slug, key): signature.save() messages.success(request, ('<h3>Many thanks for confirming your signature.</h3>' '<p>Please invite your colleagues to also sign.</p>')) + PetitionUtils.load({'petition': petition}) + PetitionUtils.send_SPB_petition_signature_thanks(signature.email) return redirect(petition.get_absolute_url()) diff --git a/templates/email/SPB_petition_signature_thanks.html b/templates/email/SPB_petition_signature_thanks.html new file mode 100644 index 0000000000000000000000000000000000000000..ba552c64f72aff6ec4f937cbbbe4210160da4d74 --- /dev/null +++ b/templates/email/SPB_petition_signature_thanks.html @@ -0,0 +1,15 @@ +<p>Many thanks for signing the petition!</p> +<p> + If you have not done so already, you can really further help SciPost convince + your institution, library and/or funding agency to become Supporting Partners + by sending a personalized email to one of their representatives; your can use our + <a href="mailto:?subject=Petition to support SciPost&body=[PLEASE FILL IN THE TO FIELD ABOVE (keeping partners@scipost.org in cc)]%0D%0A%0D%0ADear ...%0D%0A%0D%0A[PLEASE WRITE A PERSONALIZED MESSAGE]%0D%0A%0D%0AHere under, you will find basic information about SciPost and how you can support it.%0D%0A%0D%0ASincerely,%0D%0A[YOUR SIGNATURE]%0D%0A%0D%0A%0D%0A%0D%0ASciPost (https://scipost.org) is a top-quality next-generation Open Access publication portal managed by professional scientists. Its principles, ideals and implementation can be found at https://scipost.org/about and https://scipost.org/FAQ.%0D%0A%0D%0ASciPost follows a different funding model than most traditional publishers. It operates on an entirely not-for-profit basis, and charges neither subscription fees nor article processing charges; instead, its activities are financed through a cost-slashing consortial model.%0D%0A%0D%0ABy making a small financial commitment, the institutions and organizations that benefit from SciPost’s activities can become Supporting Partners. This enables SciPost to perform all of its publication-related activities, maintain its online portal and implement its long-term development plan. Details of the consortial funding scheme and how to join can be found at https://scipost.org/partners or by emailing partners@scipost.org.%0D%0A&cc=partners@scipost.org">template</a> as a start.</p> +<p> + You can also point them towards details of our consortial funding scheme on our <a href="https://scipost.org/partners">Partners page</a>, and our <a href="https://scipost.org/static/scipost/SPB/SciPost_Supporting_Partners_Board_Prospectus.pdf">one-page Prospectus</a> summarizing the scheme, which is expounded in detail in the draft <a href="https://scipost.org/static/scipost/SPB/SciPost_Supporting_Partner_Agreement.pdf">Partner Agreement</a>. +</p> +<p> + We are very grateful for your help. +</p> +<p> + The SciPost Team +</p> diff --git a/templates/email/SPB_petition_signature_thanks.txt b/templates/email/SPB_petition_signature_thanks.txt new file mode 100644 index 0000000000000000000000000000000000000000..ad8c0002e889cf3031538cbc1f9f1494e80a41ab --- /dev/null +++ b/templates/email/SPB_petition_signature_thanks.txt @@ -0,0 +1,7 @@ +Many thanks for signing the petition!\n\n +If you have not done so already, you can really further help SciPost convince +your institution, library and/or funding agency to become Supporting Partners +by sending a personalized email to one of their representatives; we have a +handy email template for you to use at https://scipost.org/partners/.\n\n +You can also point them to our prospectus and draft agreement on that same +page.\n\nWe are very grateful for your help.\n\nThe SciPost Team