}
subject = render_to_string(
- 'patchwork/patch-change-notification-subject.text',
+ 'patchwork/mails/patch-change-notification-subject.txt',
context).strip()
- content = render_to_string('patchwork/patch-change-notification.mail',
- context)
+ content = render_to_string(
+ 'patchwork/mails/patch-change-notification.txt',
+ context)
message = EmailMessage(subject=subject, body=content,
from_email=settings.NOTIFICATION_FROM_EMAIL,
+++ /dev/null
-Hi,
-
-This email is to confirm your account on the Patchwork patch-tracking
-system. You can activate your account by visiting the url:
-
- http://{{site.domain}}{% url 'registration_activateactivation_key'=request.key %}
-
-If you didn't request a user account on Patchwork, then you can ignore
-this mail.
-
-Happy patchworking.
def _optinout(request, action, description):
context = {}
- mail_template = 'patchwork/%s-request.mail' % action
+ mail_template = 'patchwork/mails/%s-request.txt' % action
html_template = 'patchwork/%s-request.html' % action
if request.method != 'POST':
conf.save()
# send email
- subject = 'Patchwork account confirmation'
+ subject = render_to_string(
+ 'patchwork/mails/activation-subject.txt')
message = render_to_string(
- 'patchwork/activation_email.txt',
+ 'patchwork/mails/activation.txt',
{'site': Site.objects.get_current(), 'confirmation': conf})
+ # TODO(stephenfin): Should this be surrounded by a try-except?
send_mail(subject, message, settings.DEFAULT_FROM_EMAIL,
[conf.email])
context['confirmation'] = conf
+ subject = 'Patchwork email address confirmation',
+ message = render_to_string('patchwork/mails/user-link.txt',
+ context, request=request)
try:
- send_mail('Patchwork email address confirmation',
- render_to_string('patchwork/user-link.mail',
- context, request=request),
+ send_mail(subject,
+ message,
settings.DEFAULT_FROM_EMAIL,
[form.cleaned_data['email']])
except smtplib.SMTPException: