Browse Source

moved subject for user notification email to events class

php2python
Holger Frey 7 years ago
parent
commit
f6b1b127d6
  1. 4
      ordr2/events.py
  2. 25
      ordr2/templates/emails/password_reset.jinja2

4
ordr2/events.py

@ -19,10 +19,12 @@ class UserNotification(object): @@ -19,10 +19,12 @@ class UserNotification(object):
class AccountActivation(UserNotification):
subject='[ordr] Your account was activated',
template = 'ordr2:templates/emails/activation.jinja2'
class PasswordReset(UserNotification):
subject='[ordr] Password Reset',
template = 'ordr2:templates/emails/password_reset.jinja2'
@ -48,7 +50,7 @@ def notify_user(event): @@ -48,7 +50,7 @@ def notify_user(event):
event.request
)
message = Message(
subject='[ordr] Your account was activated',
subject=event.subject
sender=event.request.registry.settings['mail.default_sender'],
recipients=[event.user.email],
html=body

25
ordr2/templates/emails/password_reset.jinja2

@ -0,0 +1,25 @@ @@ -0,0 +1,25 @@
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>ordr Password Reset</title>
<link href='http://fonts.googleapis.com/css?family=Anton&subset=latin,latin-ext' rel='stylesheet' type='text/css'>
<link rel="stylesheet" href="{{request.static_url('ordr2:static/css/email.css')}}" type="text/css" media="screen">
</head>
<body>
<h1>Hi there!</h1>
<p>
If you forgot your password, you can set a new one by
<a href="{{ request.resource_url(request.root, 'account', 'reset', data) }}">clicking this link.</a>
</p>
<p class="signature">
Regards,
<br/>
<span class="brand">ordr</span>
</p>
<p class="footprint">
<small>Please don't respont to this email! This is an automatically generated notification by the system.</small>
<a href="http://distractedbysquirrels.com/" target="_blank" title="This software was originally written by Sebastian Sebald." class="icon-dbs"></a>
</p>
</body>
</html>