Skip to content
Snippets Groups Projects
Commit ed9b616c authored by Julian's avatar Julian
Browse files

make context creation more beatiful

parent 5b0821e0
No related branches found
No related tags found
1 merge request!117Resolve "Use or create external library for template mailer"
Pipeline #629 failed
......@@ -224,8 +224,10 @@ class Notification(models.Model):
super().save(**kwargs)
if not self.mailed:
context = self.__dict__
context["notification_user"] = self.user.adressing_name
context = {
"notification": self,
"notification_user": self.user.adressing_name,
}
send_templated_mail(
template_name='notification',
from_email=config.MAIL_OUT,
......
......@@ -7,13 +7,13 @@
<p>{% trans "Dear" %} {{ notification_user }}, <br>
{% trans "we got a new notification for you:" %}</p>
<blockquote>
<p>{{ description }}</p>
{% if link %}
<a href="{{ link }}">{% trans "More information" %} →</a>
<p>{{ notification.description }}</p>
{% if notification.link %}
<a href="{{ notification.link }}">{% trans "More information" %} →</a>
{% endif %}
</blockquote>
{% blocktrans with trans_app=app trans_created_at=created_at %}
{% blocktrans with trans_app=notification.app trans_created_at=notification.created_at %}
<p>By {{ trans_app }} at {{ trans_created_at }}</p>
<i>Your AlekSIS team</i>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment