diff options
author | piernov <piernov@piernov.org> | 2015-02-28 21:31:32 +0100 |
---|---|---|
committer | piernov <piernov@piernov.org> | 2015-02-28 21:31:32 +0100 |
commit | 2e9a70b0a63ec72c9ff84675b23057388f054626 (patch) | |
tree | b11b4f9dd6c0db40c2be4b16c2b61c51cfcee2c0 | |
parent | 4c5f016a0db0b5758125367545bbdfca159c45b2 (diff) | |
download | jm2l-2e9a70b0a63ec72c9ff84675b23057388f054626.tar.gz jm2l-2e9a70b0a63ec72c9ff84675b23057388f054626.tar.bz2 jm2l-2e9a70b0a63ec72c9ff84675b23057388f054626.tar.xz jm2l-2e9a70b0a63ec72c9ff84675b23057388f054626.zip |
Send mail even if the user is already registered
-rw-r--r-- | jm2l/views.py | 38 |
1 files changed, 19 insertions, 19 deletions
diff --git a/jm2l/views.py b/jm2l/views.py index 8deacb2..f8fa96e 100644 --- a/jm2l/views.py +++ b/jm2l/views.py @@ -644,27 +644,27 @@ def participer(request): DBSession.flush() MyLink = TmpUsr.my_hash - mailer = request.registry['mailer'] - # Send the Welcome Mail - NewUser = TmpUsr - # Prepare Plain Text Message : - Mail_template = Template(filename='jm2l/templates/mail_plain.mako') - mail_plain = Mail_template.render(User=NewUser, action="Welcome") - body = Attachment(data=mail_plain, transfer_encoding="quoted-printable") + mailer = request.registry['mailer'] + # Send the Welcome Mail + NewUser = TmpUsr + # Prepare Plain Text Message : + Mail_template = Template(filename='jm2l/templates/mail_plain.mako') + mail_plain = Mail_template.render(User=NewUser, action="Welcome") + body = Attachment(data=mail_plain, transfer_encoding="quoted-printable") - # Prepare HTML Message : - Mail_template = Template(filename='jm2l/templates/mail_html.mako') - mail_html = Mail_template.render(User=NewUser, action="Welcome") - html = Attachment(data=mail_html, transfer_encoding="quoted-printable") + # Prepare HTML Message : + Mail_template = Template(filename='jm2l/templates/mail_html.mako') + mail_html = Mail_template.render(User=NewUser, action="Welcome") + html = Attachment(data=mail_html, transfer_encoding="quoted-printable") - # Prepare Message - message = Message(subject="[JM2L] Mon inscription au site web JM2L", - sender="contact@jm2l.linux-azur.org", - recipients=[NewUser.mail], - body=body, html=html) + # Prepare Message + message = Message(subject="[JM2L] Mon inscription au site web JM2L", + sender="contact@jm2l.linux-azur.org", + recipients=[NewUser.mail], + body=body, html=html) - message.add_bcc("spam@style-python.fr") - mailer.send(message) + message.add_bcc("spam@style-python.fr") + mailer.send(message) @@ -1067,4 +1067,4 @@ def forbidden(reason, request): #return Response('forbidden') request.response.status = 404 return render_to_response('jm2l:templates/Errors/404.mak', { "reason":reason }, - request=request)
\ No newline at end of file + request=request) |