From 2452a3497cfe3a9c93a2e9fce150f6abaae3776d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89lie=20Bouttier?= Date: Fri, 11 Aug 2017 23:25:42 +0200 Subject: [PATCH] footer in mail notifications --- cfp/forms.py | 2 +- .../0007_conference_secure_domain.py | 20 ++++ cfp/models.py | 1 + cfp/signals.py | 9 +- locale/fr/LC_MESSAGES/django.mo | Bin 20854 -> 20919 bytes locale/fr/LC_MESSAGES/django.po | 90 +++++++++--------- mailing/models.py | 7 +- 7 files changed, 81 insertions(+), 48 deletions(-) create mode 100644 cfp/migrations/0007_conference_secure_domain.py diff --git a/cfp/forms.py b/cfp/forms.py index 86da851..f852e46 100644 --- a/cfp/forms.py +++ b/cfp/forms.py @@ -101,7 +101,7 @@ class UsersWidget(ModelSelect2MultipleWidget): class ConferenceForm(forms.ModelForm): class Meta: model = Conference - fields = ['name', 'home', 'venue', 'city', 'contact_email', 'reply_email', 'staff',] + fields = ['name', 'home', 'venue', 'city', 'contact_email', 'reply_email', 'secure_domain', 'staff',] widgets = { 'staff': UsersWidget(), } diff --git a/cfp/migrations/0007_conference_secure_domain.py b/cfp/migrations/0007_conference_secure_domain.py new file mode 100644 index 0000000..66e9705 --- /dev/null +++ b/cfp/migrations/0007_conference_secure_domain.py @@ -0,0 +1,20 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.11.3 on 2017-08-11 21:18 +from __future__ import unicode_literals + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('cfp', '0006_auto_20170811_1457'), + ] + + operations = [ + migrations.AddField( + model_name='conference', + name='secure_domain', + field=models.BooleanField(default=True, verbose_name='Secure domain'), + ), + ] diff --git a/cfp/models.py b/cfp/models.py index ebb1061..636dede 100644 --- a/cfp/models.py +++ b/cfp/models.py @@ -30,6 +30,7 @@ class Conference(models.Model): contact_email = models.CharField(max_length=100, blank=True, verbose_name=_('Contact email')) reply_email = models.CharField(max_length=100, blank=True, verbose_name=_('Reply email')) staff = models.ManyToManyField(User, blank=True, verbose_name=_('Staff members')) + secure_domain = models.BooleanField(default=True, verbose_name=_('Secure domain (HTTPS)')) custom_css = models.TextField(blank=True) external_css_link = models.URLField(blank=True) diff --git a/cfp/signals.py b/cfp/signals.py index d82cd75..1675b8f 100644 --- a/cfp/signals.py +++ b/cfp/signals.py @@ -4,6 +4,7 @@ from django.contrib.sites.models import Site from django.conf import settings from django.utils.translation import ugettext_lazy as _ from django.contrib.auth.models import User +from django.core.urlresolvers import reverse from ponyconf.decorators import disable_for_loaddata from mailing.models import MessageThread, Message @@ -77,6 +78,8 @@ def send_message_notifications(sender, instance, **kwargs): participant_dests = [ (participant.name, participant.email) ] participant_subject = _('[%(prefix)s] Message from the staff') % {'prefix': conf.name} staff_subject = _('[%(prefix)s] Conversation with %(dest)s') % {'prefix': conf.name, 'dest': participant.name} + proto = 'https' if conf.secure_domain else 'http' + footer = '\n\n--\n%s://' % proto + conf.site.domain + reverse('participant-details', args=[participant.token]) if message.from_email == conf.contact_email: # this is a talk notification message # send it only to the participant message.send_notification(subject=subject_prefix+participant_subject, sender=sender, dests=participant_dests, @@ -84,15 +87,17 @@ def send_message_notifications(sender, instance, **kwargs): else: # this is a message between the staff and the participant message.send_notification(subject=subject_prefix+staff_subject, sender=sender, dests=staff_dests, - reply_to=reply_to, message_id=message_id, reference=reference) + reply_to=reply_to, message_id=message_id, reference=reference, footer=footer) if message.from_email != thread.participant.email: # message from staff: sent it to the participant too message.send_notification(subject=subject_prefix+participant_subject, sender=sender, dests=participant_dests, reply_to=reply_to, message_id=message_id, reference=reference) elif hasattr(thread, 'talk'): conf = thread.talk.site.conference subject = _('[%(prefix)s] Talk: %(talk)s') % {'prefix': conf.name, 'talk': thread.talk.title} + proto = 'https' if conf.secure_domain else 'http' + footer = '\n\n--\n%s://' % proto + conf.site.domain + reverse('talk-details', args=[thread.talk.token]) message.send_notification(subject=subject_prefix+subject, sender=sender, dests=staff_dests, - reply_to=reply_to, message_id=message_id, reference=reference) + reply_to=reply_to, message_id=message_id, reference=reference, footer=footer) # connected in apps.py diff --git a/locale/fr/LC_MESSAGES/django.mo b/locale/fr/LC_MESSAGES/django.mo index f8a7c73172eb498ed27e962c1e54f5bf8d1711f0..ed69bb9ebda103c8dc7dbdd251fc6c8b06ef3757 100644 GIT binary patch delta 5609 zcmYk=33!cH9>?($vXew|6IX1xA+j`rSd)k)Ll#?^Qer4Fn2C@YJeV?dr8-J!I_(`x zJ)}{iL(4PBsId*T6t&k_sIp=-P^8U|xZ~FAX2Y#DY z_<1ix`7bbB4gCnL4mM^w<#Um0HDKjr0k7B4XUUStx@I8ieMm;>HlUu0nV657pbXP+0d~UOsD=2| zHzoi>Q46etN!S5Ha5zRXzZqj2reh#Cevc72-?lHsy3{|k_qQV}H+xVM9mOy_gX(t; zqwoRxV+gCRgW=d8<52x4VFdG=85H!UE|nqVC^#m%S;okw2M+`?!KWZ(2$ z1JptjP+QOuwV(pj_=QMv%_!9FzKUKA_%;PiT!C8gho}x8quyi_YM{?iDLspN{t{{n zuA@>~jmltPBV*Dr43n`7Hp61n87jx-xULcT?@8f24H_t!lcrQ(p)zv@8Pi-rUfTFKamI;94cr2isjjFO%0p#nkhRF(AM2%{y`6x1!v*$%3hOG= zo^3$BJaZ6rHZG$+qdTa6K@6e^>Yxr+ePnH>8EWhD?fpThj1{34=KU1~rDiJX&E{Db zp*pU>Zdiqy@FA*WSc3DWjZq71h00_P)ItVYN7(if)Iz7)_L;~+z2;4)U>2YTsKjBo z7L~%N)=;ryhmMcw?;1 z{H8SprK}4EU=Q@izNmo*px*Q))E1Q5`?F9BnuDWo5$esVQ7;si?3{s2)WU{fbDU(Y zL~k$+hbd^{Q>epp4z=QMFc9xst5KP#nd01!M?K#X*)5Z0>%&o7R$}Y3ZT%h8JZn*B zrYeQ}=TSIBLn*qRb2^q;mtjlVH)Bt{fi19YsxfpiBT+vzZ=nX>fm-lhTR&v$Us%7i z?U!u*S}OTh$J;dMyS0ResLbw0ZQXINZMcMb@LSX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 z4%4@&2Cks?>^^GGqYB*y5-^;666(39Q1{!S4(qcRii1!Cdd1!!i+<#X5`QE(V#c`` zRmU&Xxf_)dqIJ5&tH1@Z+fY_}WZDZ_5XScBU0km;1NS&&lw_ zh1?-EoY?6UdQ$wVo!@(se4EIBPUs5c>1f-c4vChzHBn5QB(@OuiMvD$&pp6x#Jfai z;s~KruQx*1N@5?O|24aU?Fm-b93<>D(hMP`llLRBlxRczi+FrFBu)^2A`TN@6WX_b z5(^0(9$jaN>yJ`=aPS^cMvNjN7{D24n%C3ZL+St}`-#Wb9uiH7KwD6oXLN0MD!p;_ zzaiC+;KeYX5qZSV!~)`+bJN=*s)E%2U;lAh$K=QSL{TH63GrWhyT+Ll<7s$^oPG#& z%_d^$Zw%H!-X0U;?2bwA6ijX%IeqtjAx0Bjh`$nDiLVG<*NCgc3q%lgR^c+@w389* z$%v;!R}11h;*v64H;A>wr^H^Ogs38JIgk diff --git a/locale/fr/LC_MESSAGES/django.po b/locale/fr/LC_MESSAGES/django.po index 453021c..74c014c 100644 --- a/locale/fr/LC_MESSAGES/django.po +++ b/locale/fr/LC_MESSAGES/django.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2017-08-02 18:25+0000\n" +"POT-Creation-Date: 2017-08-11 21:21+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -24,31 +24,31 @@ msgstr "" "Par exemple, vous devez rentrer le samedi soir, vous ne pouvez pas manger de " "viande, etc." -#: accounts/models.py:18 cfp/models.py:83 +#: accounts/models.py:18 cfp/models.py:96 msgid "Phone number" msgstr "Numéro de téléphone" -#: accounts/models.py:20 cfp/models.py:76 +#: accounts/models.py:20 cfp/models.py:89 msgid "Twitter" msgstr "" -#: accounts/models.py:21 cfp/models.py:77 +#: accounts/models.py:21 cfp/models.py:90 msgid "LinkedIn" msgstr "" -#: accounts/models.py:22 cfp/models.py:78 +#: accounts/models.py:22 cfp/models.py:91 msgid "Github" msgstr "" -#: accounts/models.py:23 cfp/models.py:79 +#: accounts/models.py:23 cfp/models.py:92 msgid "Website" msgstr "" -#: accounts/models.py:24 cfp/models.py:80 +#: accounts/models.py:24 cfp/models.py:93 msgid "Facebook" msgstr "" -#: accounts/models.py:25 cfp/models.py:81 +#: accounts/models.py:25 cfp/models.py:94 msgid "Mastodon" msgstr "" @@ -100,7 +100,7 @@ msgstr "Contacter" msgid "Edit" msgstr "Éditer" -#: accounts/templates/accounts/participant_details.html:20 cfp/models.py:73 +#: accounts/templates/accounts/participant_details.html:20 cfp/models.py:86 #: cfp/templates/cfp/staff/participant_details.html:10 msgid "Biography" msgstr "Biographie" @@ -174,7 +174,7 @@ msgid "Constraints" msgstr "Contraintes" #: accounts/templates/accounts/participant_details.html:71 cfp/forms.py:53 -#: cfp/models.py:87 cfp/templates/cfp/staff/participant_details.html:14 +#: cfp/models.py:100 cfp/templates/cfp/staff/participant_details.html:14 #: cfp/templates/cfp/staff/talk_details.html:92 proposals/models.py:161 #: proposals/templates/proposals/talk_detail.html:102 msgid "Notes" @@ -312,7 +312,7 @@ msgstr "Catégorie" msgid "Title" msgstr "Titre" -#: cfp/forms.py:52 cfp/models.py:141 +#: cfp/forms.py:52 cfp/models.py:156 #: cfp/templates/cfp/staff/talk_details.html:71 proposals/models.py:54 #: proposals/models.py:77 proposals/models.py:158 #: proposals/templates/proposals/talk_detail.html:72 volunteers/models.py:14 @@ -330,7 +330,7 @@ msgstr "Visible par les orateurs" msgid "Status" msgstr "Statut" -#: cfp/forms.py:74 cfp/models.py:243 +#: cfp/forms.py:74 cfp/models.py:258 #: cfp/templates/cfp/staff/talk_details.html:85 #: cfp/templates/cfp/staff/talk_list.html:41 #: cfp/templates/cfp/staff/track_form.html:14 proposals/models.py:160 @@ -370,35 +370,39 @@ msgstr "Un utilisateur avec ce prénom et ce nom existe déjà." msgid "A user with that email already exists." msgstr "Un utilisateur avec cet email existe déjà." -#: cfp/models.py:25 +#: cfp/models.py:26 msgid "Conference name" msgstr "Nom de la conférence" -#: cfp/models.py:26 +#: cfp/models.py:27 msgid "Homepage (markdown)" msgstr "Page d’accueil (markdown)" -#: cfp/models.py:27 +#: cfp/models.py:28 msgid "Venue information" msgstr "Informations sur le lieu" -#: cfp/models.py:28 +#: cfp/models.py:29 msgid "City" msgstr "Ville" -#: cfp/models.py:29 +#: cfp/models.py:30 msgid "Contact email" msgstr "Email de contact" -#: cfp/models.py:30 +#: cfp/models.py:31 msgid "Reply email" msgstr "Adresse de réponse" -#: cfp/models.py:31 +#: cfp/models.py:32 msgid "Staff members" msgstr "Membres du staff" -#: cfp/models.py:59 +#: cfp/models.py:33 +msgid "Secure domain (HTTPS)" +msgstr "Domaine sécurisé (HTTPS)" + +#: cfp/models.py:61 #, python-brace-format msgid "" "The reply email should be a formatable string accepting a token argument (e." @@ -407,33 +411,33 @@ msgstr "" "L’adresse de réponse doit être une chaine de texte formatable avec un " "argument « token » (e.g. ponyconf+{token}@exemple.com)." -#: cfp/models.py:70 +#: cfp/models.py:83 msgid "Your Name" msgstr "Votre Nom" -#: cfp/models.py:87 +#: cfp/models.py:100 msgid "This field is only visible by organizers." msgstr "Ce champs est uniquement visible par les organisateurs." -#: cfp/models.py:139 cfp/templates/cfp/staff/participant_list.html:49 +#: cfp/models.py:154 cfp/templates/cfp/staff/participant_list.html:49 #: proposals/models.py:52 proposals/models.py:75 proposals/models.py:132 #: volunteers/models.py:12 msgid "Name" msgstr "Nom" -#: cfp/models.py:162 proposals/models.py:96 +#: cfp/models.py:177 proposals/models.py:96 msgid "Default duration (min)" msgstr "Durée par défaut (min)" -#: cfp/models.py:163 proposals/models.py:97 +#: cfp/models.py:178 proposals/models.py:97 msgid "Color on program" msgstr "Couleur sur le programme" -#: cfp/models.py:164 proposals/models.py:98 +#: cfp/models.py:179 proposals/models.py:98 msgid "Label on program" msgstr "Label dans le xml du programme" -#: cfp/models.py:238 cfp/templates/cfp/staff/base.html:19 +#: cfp/models.py:253 cfp/templates/cfp/staff/base.html:19 #: cfp/templates/cfp/staff/participant_list.html:8 #: cfp/templates/cfp/staff/talk_details.html:75 #: cfp/templates/cfp/staff/talk_list.html:40 proposals/models.py:154 @@ -443,19 +447,19 @@ msgstr "Label dans le xml du programme" msgid "Speakers" msgstr "Orateurs" -#: cfp/models.py:239 +#: cfp/models.py:254 msgid "Talk Title" msgstr "Titre de votre proposition:" -#: cfp/models.py:242 +#: cfp/models.py:257 msgid "Description of your talk" msgstr "Description de votre proposition" -#: cfp/models.py:244 +#: cfp/models.py:259 msgid "Message to organizers" msgstr "Message aux organisateurs" -#: cfp/models.py:244 +#: cfp/models.py:259 msgid "" "If you have any constraint or if you have anything that may help you to " "select your talk, like a video or slides of your talk, please write it down " @@ -465,37 +469,37 @@ msgstr "" "votre proposition, comme une vidéo, des slides, n'hésitez pas à les ajouter " "ici." -#: cfp/models.py:245 +#: cfp/models.py:260 msgid "Talk Category" msgstr "Catégorie de proposition" -#: cfp/models.py:246 +#: cfp/models.py:261 msgid "I'm ok to be recorded on video" msgstr "J’accepte d’être enregistré en vidéo" -#: cfp/models.py:247 +#: cfp/models.py:262 msgid "Video licence" msgstr "Licence vidéo" -#: cfp/models.py:248 +#: cfp/models.py:263 msgid "I need sound" msgstr "J’ai besoin de son" -#: cfp/models.py:251 proposals/models.py:165 +#: cfp/models.py:266 proposals/models.py:165 msgid "Duration (min)" msgstr "Durée (min)" -#: cfp/signals.py:78 +#: cfp/signals.py:79 #, python-format msgid "[%(prefix)s] Message from the staff" msgstr "[%(prefix)s] Message du staff" -#: cfp/signals.py:79 +#: cfp/signals.py:80 #, python-format msgid "[%(prefix)s] Conversation with %(dest)s" msgstr "[%(prefix)s] Conversation avec %(dest)s" -#: cfp/signals.py:93 +#: cfp/signals.py:96 #, python-format msgid "[%(prefix)s] Talk: %(talk)s" msgstr "[%(prefix)s] Talk: %(talk)s" @@ -959,7 +963,7 @@ msgid "You can use this page to communicate with the staff." msgstr "" "Vous pouvez utiliser cette page pour communiquer avec l’équipe organisatrice." -#: mailing/models.py:90 +#: mailing/models.py:93 #, python-format msgid "Message from %(author)s" msgstr "Message de %(author)s" @@ -1011,11 +1015,11 @@ msgstr "Certains exposés ne sont pas encore planifiés." msgid "No rooms." msgstr "Aucune salle." -#: ponyconf/settings.py:147 +#: ponyconf/settings.py:146 msgid "English" msgstr "Anglais" -#: ponyconf/settings.py:148 +#: ponyconf/settings.py:147 msgid "French" msgstr "Français" @@ -1059,7 +1063,7 @@ msgstr "Mot de passe oublié ?" msgid "Password Change" msgstr "Changement de mot de passe" -#: ponyconf/urls.py:26 +#: ponyconf/urls.py:27 msgid "Email address" msgstr "" diff --git a/mailing/models.py b/mailing/models.py index c26bafe..837fbfa 100644 --- a/mailing/models.py +++ b/mailing/models.py @@ -45,7 +45,7 @@ class Message(models.Model): class Meta: ordering = ['created'] - def send_notification(self, subject, sender, dests, reply_to=None, message_id=None, reference=None): + def send_notification(self, subject, sender, dests, reply_to=None, message_id=None, reference=None, footer=None): messages = [] for dest_name, dest_email in dests: correspondent, created = MessageCorrespondent.objects.get_or_create(email=dest_email) @@ -64,9 +64,12 @@ class Message(models.Model): headers.update({ 'References': message_id.format(id=reference), }) + body = self.content + if footer is not None: + body += footer messages.append(EmailMessage( subject=subject, - body=self.content, + body=body, from_email='%s <%s>' % sender, to=['%s <%s>' % (dest_name, dest_email)], reply_to=reply_to_list,