better subjects for content team emails, and add quotes in body

This commit is contained in:
Thomas Steen Rasmussen 2019-07-21 15:26:57 +02:00
parent 1d24878ece
commit d276032389
9 changed files with 38 additions and 42 deletions

View file

@ -12,70 +12,66 @@ def add_new_speakerproposal_email(speakerproposal):
try: try:
content_team = Team.objects.get(camp=speakerproposal.camp, name="Content") content_team = Team.objects.get(camp=speakerproposal.camp, name="Content")
except ObjectDoesNotExist as e:
logger.info("There is no team with name Content: {}".format(e))
return False
return add_outgoing_email( return add_outgoing_email(
text_template="emails/new_speakerproposal.txt", text_template="emails/new_speakerproposal.txt",
html_template="emails/new_speakerproposal.html", html_template="emails/new_speakerproposal.html",
to_recipients=content_team.mailing_list, to_recipients=content_team.mailing_list,
formatdict=formatdict, formatdict=formatdict,
subject="New speaker proposal for {}".format(speakerproposal.camp.title), subject="New speaker proposal '%s' was just submitted" % speakerproposal.name,
) )
except ObjectDoesNotExist as e:
logger.info("There is no team with name Content: {}".format(e))
return False
def add_new_eventproposal_email(eventproposal): def add_new_eventproposal_email(eventproposal):
formatdict = {"proposal": eventproposal} formatdict = {"proposal": eventproposal}
try: try:
content_team = Team.objects.get(camp=eventproposal.camp, name="Content") content_team = Team.objects.get(camp=eventproposal.camp, name="Content")
except ObjectDoesNotExist as e:
logger.info("There is no team with name Content: {}".format(e))
return False
return add_outgoing_email( return add_outgoing_email(
text_template="emails/new_eventproposal.txt", text_template="emails/new_eventproposal.txt",
html_template="emails/new_eventproposal.html", html_template="emails/new_eventproposal.html",
to_recipients=content_team.mailing_list, to_recipients=content_team.mailing_list,
formatdict=formatdict, formatdict=formatdict,
subject="New event proposal for {}".format(eventproposal.camp.title), subject="New event proposal '%s' was just submitted" % eventproposal.title,
) )
except ObjectDoesNotExist as e:
logger.info("There is no team with name Content: {}".format(e))
return False
def add_speakerproposal_updated_email(speakerproposal): def add_speakerproposal_updated_email(speakerproposal):
formatdict = {"proposal": speakerproposal} formatdict = {"proposal": speakerproposal}
try: try:
content_team = Team.objects.get(camp=speakerproposal.camp, name="Content") content_team = Team.objects.get(camp=speakerproposal.camp, name="Content")
except ObjectDoesNotExist as e:
logger.info("There is no team with name Content: {}".format(e))
return False
return add_outgoing_email( return add_outgoing_email(
text_template="emails/update_speakerproposal.txt", text_template="emails/update_speakerproposal.txt",
html_template="emails/update_speakerproposal.html", html_template="emails/update_speakerproposal.html",
to_recipients=content_team.mailing_list, to_recipients=content_team.mailing_list,
formatdict=formatdict, formatdict=formatdict,
subject="Updated speaker proposal for {}".format( subject="Speaker proposal '%s' was just updated" % speakerproposal.name,
speakerproposal.camp.title
),
) )
except ObjectDoesNotExist as e:
logger.info("There is no team with name Content: {}".format(e))
return False
def add_eventproposal_updated_email(eventproposal): def add_eventproposal_updated_email(eventproposal):
formatdict = {"proposal": eventproposal} formatdict = {"proposal": eventproposal}
try: try:
content_team = Team.objects.get(camp=eventproposal.camp, name="Content") content_team = Team.objects.get(camp=eventproposal.camp, name="Content")
except ObjectDoesNotExist as e:
logger.info("There is no team with name Content: {}".format(e))
return False
return add_outgoing_email( return add_outgoing_email(
text_template="emails/update_eventproposal.txt", text_template="emails/update_eventproposal.txt",
html_template="emails/update_eventproposal.html", html_template="emails/update_eventproposal.html",
to_recipients=content_team.mailing_list, to_recipients=content_team.mailing_list,
formatdict=formatdict, formatdict=formatdict,
subject="New event proposal for {}".format(eventproposal.camp.title), subject="Event proposal '%s' was just updated" % eventproposal.title,
) )
except ObjectDoesNotExist as e:
logger.info("There is no team with name Content: {}".format(e))
return False

View file

@ -1,6 +1,6 @@
Hello!<br> Hello!<br>
<br> <br>
Event {{ proposal.title }} was just submitted as a new proposal for {{ proposal.camp }}. Event "{{ proposal.title }}" was just submitted as a new proposal for {{ proposal.camp }}.
<br> <br>
<br> <br>
More info <a href="https://bornhack.dk/admin/program/eventproposal/{{ proposal.uuid }}/change/">here</a>. More info <a href="https://bornhack.dk/admin/program/eventproposal/{{ proposal.uuid }}/change/">here</a>.

View file

@ -1,6 +1,6 @@
Hello! Hello!
Event {{ proposal.title }} was just submitted as a new proposal for {{ proposal.camp }}. Event "{{ proposal.title }}" was just submitted as a new proposal for {{ proposal.camp }}.
More info: https://bornhack.dk/admin/program/eventproposal/{{ proposal.uuid }}/change/ More info: https://bornhack.dk/admin/program/eventproposal/{{ proposal.uuid }}/change/

View file

@ -1,6 +1,6 @@
Hello!<br> Hello!<br>
<br> <br>
Speaker {{ proposal.name }} was just submitted as a new proposal for {{ proposal.camp }}. Speaker "{{ proposal.name }}" was just submitted as a new proposal for {{ proposal.camp }}.
<br> <br>
<br> <br>
More info <a href="https://bornhack.dk/admin/program/speakerproposal/{{ proposal.uuid }}/change/">here</a>. More info <a href="https://bornhack.dk/admin/program/speakerproposal/{{ proposal.uuid }}/change/">here</a>.

View file

@ -1,6 +1,6 @@
Hello! Hello!
Speaker {{ proposal.name }} was just submitted as a new proposal for {{ proposal.camp }}. Speaker "{{ proposal.name }}" was just submitted as a new proposal for {{ proposal.camp }}.
More info: https://bornhack.dk/admin/program/speakerproposal/{{ proposal.uuid }}/change/ More info: https://bornhack.dk/admin/program/speakerproposal/{{ proposal.uuid }}/change/

View file

@ -1,6 +1,6 @@
Hello!<br> Hello!<br>
<br> <br>
Event {{ proposal.name }} for {{ proposal.camp }} was just updated! Event "{{ proposal.name }}" for {{ proposal.camp }} was just updated!
<br> <br>
<br> <br>
More info <a href="https://bornhack.dk/admin/program/eventproposal/{{ proposal.uuid }}/change/">here</a>. More info <a href="https://bornhack.dk/admin/program/eventproposal/{{ proposal.uuid }}/change/">here</a>.

View file

@ -1,6 +1,6 @@
Hello! Hello!
Event {{ proposal.name }} for {{ proposal.camp }} was just updated! Event "{{ proposal.name }}" for {{ proposal.camp }} was just updated!
More info: https://bornhack.dk/admin/program/eventproposal/{{ proposal.uuid }}/change/ More info: https://bornhack.dk/admin/program/eventproposal/{{ proposal.uuid }}/change/

View file

@ -1,6 +1,6 @@
Hello!<br> Hello!<br>
<br> <br>
Speaker {{ proposal.name }} for {{ proposal.camp }} was just updated! Speaker "{{ proposal.name }}" for {{ proposal.camp }} was just updated!
<br> <br>
<br> <br>
More info <a href="https://bornhack.dk/admin/program/speakerproposal/{{ proposal.uuid }}/change/">here</a>. More info <a href="https://bornhack.dk/admin/program/speakerproposal/{{ proposal.uuid }}/change/">here</a>.

View file

@ -1,6 +1,6 @@
Hello! Hello!
Speaker {{ proposal.name }} was just submitted as a new speaker proposal for {{ proposal.camp }}. Speaker "{{ proposal.name }}" was just submitted as a new speaker proposal for {{ proposal.camp }}.
More info: https://bornhack.dk/admin/program/speakerproposal/{{ proposal.uuid }}/change/ More info: https://bornhack.dk/admin/program/speakerproposal/{{ proposal.uuid }}/change/