Merge pull request #1071 from migonzalvar/TG-5334
Add unsubscribe link to every notification emailremotes/origin/release/3.1.1
commit
880289b0a7
|
@ -435,7 +435,10 @@
|
|||
<tr>
|
||||
<td valign="top" class="footerContent">
|
||||
{% block footer %}
|
||||
{% trans support_url=sr("support.url"), support_email=sr("support.email"), mailing_list_url=sr("support.mailing_list") %}
|
||||
{% trans unsubscribe_url=resolve_front_url("settings-mail-notifications"), support_url=sr("support.url"), support_email=sr("support.email"), mailing_list_url=sr("support.mailing_list") %}
|
||||
<strong>Configure email notifications or unsubscribe:</strong>
|
||||
<a href="{{ unsubscribe_url }}" title="Unsubscribe" style="color: #9dce0a">{{ unsubscribe_url}}</a>
|
||||
<br>
|
||||
<strong>Taiga Support:</strong>
|
||||
<a href="{{ support_url }}" title="Support page" style="color: #9dce0a">{{ support_url}}</a>
|
||||
<br>
|
||||
|
|
|
@ -394,7 +394,10 @@
|
|||
<tr>
|
||||
<td valign="top" class="footerContent">
|
||||
{% block footer %}
|
||||
{% trans support_url=sr("support.url"), support_email=sr("support.email"), mailing_list_url=sr("support.mailing_list") %}
|
||||
{% trans unsubscribe_url=resolve_front_url("settings-mail-notifications"), support_url=sr("support.url"), support_email=sr("support.email"), mailing_list_url=sr("support.mailing_list") %}
|
||||
<strong>Configure email notifications or unsubscribe:</strong>
|
||||
<a href="{{ unsubscribe_url }}" title="Unsubscribe" style="color: #9dce0a">{{ unsubscribe_url}}</a>
|
||||
<br>
|
||||
<strong>Taiga Support:</strong>
|
||||
<a href="{{ support_url }}" title="Support page" style="color: #9dce0a">{{ support_url}}</a>
|
||||
<br>
|
||||
|
|
|
@ -456,7 +456,10 @@
|
|||
<tr>
|
||||
<td valign="top" class="footerContent">
|
||||
{% block footer %}
|
||||
{% trans support_url=sr("support.url"), support_email=sr("support.email"), mailing_list_url=sr("support.mailing_list") %}
|
||||
{% trans unsubscribe_url=resolve_front_url("settings-mail-notifications"), support_url=sr("support.url"), support_email=sr("support.email"), mailing_list_url=sr("support.mailing_list") %}
|
||||
<strong>Configure email notifications or unsubscribe:</strong>
|
||||
<a href="{{ unsubscribe_url }}" title="Unsubscribe" style="color: #9dce0a">{{ unsubscribe_url}}</a>
|
||||
<br>
|
||||
<strong>Taiga Support:</strong>
|
||||
<a href="{{ support_url }}" title="Support page" style="color: #9dce0a">{{ support_url}}</a>
|
||||
<br>
|
||||
|
|
|
@ -25,6 +25,7 @@ urls = {
|
|||
"forgot-password": "/forgot-password",
|
||||
"new-project": "/project/new",
|
||||
"new-project-import": "/project/new/import/{0}",
|
||||
"settings-mail-notifications": "/user-settings/mail-notifications",
|
||||
|
||||
"change-password": "/change-password/{0}", # user.token
|
||||
"change-email": "/change-email/{0}", # user.email_token
|
||||
|
|
|
@ -7,7 +7,7 @@ msgid ""
|
|||
msgstr ""
|
||||
"Project-Id-Version: taiga-back\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2017-10-06 11:42+0200\n"
|
||||
"POT-Creation-Date: 2018-02-08 12:00+0100\n"
|
||||
"PO-Revision-Date: 2015-03-25 20:09+0100\n"
|
||||
"Last-Translator: Taiga Dev Team <support@taiga.io>\n"
|
||||
"Language-Team: Taiga Dev Team <support@taiga.io>\n"
|
||||
|
@ -396,6 +396,12 @@ msgstr ""
|
|||
#, python-format
|
||||
msgid ""
|
||||
"\n"
|
||||
" <strong>Configure email "
|
||||
"notifications or unsubscribe:</strong>\n"
|
||||
" <a href="
|
||||
"\"%(unsubscribe_url)s\" title=\"Unsubscribe\" style=\"color: #9dce0a\">"
|
||||
"%(unsubscribe_url)s</a>\n"
|
||||
" <br>\n"
|
||||
" <strong>Taiga Support:</"
|
||||
"strong>\n"
|
||||
" <a href=\"%(support_url)s"
|
||||
|
|
|
@ -31,6 +31,7 @@ from django.utils.translation import ugettext as _
|
|||
|
||||
from taiga.base import exceptions as exc
|
||||
from taiga.base.mails import InlineCSSTemplateMail
|
||||
from taiga.front.templatetags.functions import resolve as resolve_front_url
|
||||
from taiga.projects.notifications.choices import NotifyLevel
|
||||
from taiga.projects.history.choices import HistoryType
|
||||
from taiga.projects.history.services import (make_key_from_model_object,
|
||||
|
@ -276,6 +277,7 @@ def send_sync_notifications(notification_id):
|
|||
|
||||
now = datetime.datetime.now()
|
||||
format_args = {
|
||||
"unsubscribe_url": resolve_front_url('settings-mail-notifications'),
|
||||
"project_slug": notification.project.slug,
|
||||
"project_name": notification.project.name,
|
||||
"msg_id": msg_id,
|
||||
|
@ -288,7 +290,8 @@ def send_sync_notifications(notification_id):
|
|||
"In-Reply-To": "<{project_slug}/{msg_id}@{domain}>".format(**format_args),
|
||||
"References": "<{project_slug}/{msg_id}@{domain}>".format(**format_args),
|
||||
"List-ID": 'Taiga/{project_name} <taiga.{project_slug}@{domain}>'.format(**format_args),
|
||||
"Thread-Index": make_ms_thread_index("<{project_slug}/{msg_id}@{domain}>".format(**format_args), now)
|
||||
"Thread-Index": make_ms_thread_index("<{project_slug}/{msg_id}@{domain}>".format(**format_args), now),
|
||||
"List-Unsubscribe": "<{unsubscribe_url}>".format(**format_args),
|
||||
}
|
||||
|
||||
for user in notification.notify_users.distinct():
|
||||
|
|
Loading…
Reference in New Issue