Skip to content

Saleor Core: the high performance, composable, headless commerce API.

Add link to dashboard in promote customer e-mail

Anna Siwik8d8ef3dd29c7
diff --git a/saleor/dashboard/emails.py b/saleor/dashboard/emails.py
index 52b47a008e..1ffd31bea0 100644
--- a/saleor/dashboard/emails.py
+++ b/saleor/dashboard/emails.py
@@ -2,10 +2,13 @@ from celery import shared_task
from django.conf import settings
from django.contrib.auth.tokens import default_token_generator
from django.contrib.sites.models import Site
+from django.urls import reverse
from django.utils.encoding import force_bytes
from django.utils.http import urlsafe_base64_encode
from templated_email import send_templated_mail
+from ..core.utils import build_absolute_uri
+
@shared_task
def send_set_password_email(staff):
@@ -29,6 +32,7 @@ def send_promote_customer_to_staff_email(staff):
ctx = {
'protocol': 'http',
'domain': site.domain,
+ 'url': build_absolute_uri(reverse('dashboard:index')),
'site_name': site.name}
send_templated_mail(
template_name='dashboard/staff/promote_customer',
diff --git a/templates/templated_email/html/source/dashboard/staff/promote_customer.mjml b/templates/templated_email/html/source/dashboard/staff/promote_customer.mjml
index fa64fe9910..4c6b84db1b 100644
--- a/templates/templated_email/html/source/dashboard/staff/promote_customer.mjml
+++ b/templates/templated_email/html/source/dashboard/staff/promote_customer.mjml
@@ -19,7 +19,8 @@
</mj-text>
<mj-text>
{% blocktrans context "Promote customer to staff member confirmation e-mail text" %}
- You're receiving this e-mail because you have been promoted to staff member at {{ domain }}.
+ You're receiving this e-mail because you have been promoted to staff member at {{ domain }}.<br/>
+ To access dashboard please visit: <a href="{{ url }}">{{ url }}</a>
{% endblocktrans %}
</mj-text>
</mj-column>