Browse Source

Send welcome message from administrative email

Jocelyn Delande 9 years ago
parent
commit
979fb7bb01
1 changed files with 8 additions and 1 deletions
  1. 8 1
      coin/members/models.py

+ 8 - 1
coin/members/models.py

@@ -258,11 +258,18 @@ class Member(CoinLdapSyncMixin, AbstractUser):
         """ Envoie le courriel de bienvenue à ce membre """
         from coin.isp_database.models import ISPInfo
 
+        isp_info = ISPInfo.objects.first()
+
+        kwargs = {}
+        if isp_info.administrative_email:
+            kwargs['from_email'] = isp_info.administrative_email
+
         utils.send_templated_email(
             to=self.email,
             subject_template='members/emails/welcome_email_subject.txt',
             body_template='members/emails/welcome_email.html',
-            context={'member': self, 'branding': ISPInfo.objects.first()})
+            context={'member': self, 'branding': isp_info},
+            **kwargs)
 
     def send_call_for_membership_fees_email(self, auto=False):
         """ Envoie le courriel d'appel à cotisation du membre