Skip to content

Commit 865b15a

Browse files
committed
pass sharer_message and put it in a box
1 parent 1ed4955 commit 865b15a

File tree

3 files changed

+13
-3
lines changed

3 files changed

+13
-3
lines changed

packages/notifications-library/src/notifications_library/templates/on_share_project.email.content.html

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,21 @@
55

66
<p>Great news! {{ sharer_username }} has shared a {{ resource_alias }} with you on {{ product.display_name }}.</p>
77

8-
<p>To view the {{ resource_alias }} and accept the sharing, simply click the button below:</p>
8+
<p>To view the {{ resource_alias }} and accept the sharing, follow below:</p>
99

1010
<p>
11-
<!-- Many email clients strip or ignore certain CSS properties, including them inline -->
11+
{% if sharer_message %}
12+
<div style="border: 1px solid #ccc; padding: 16px; border-radius: 8px; background-color: #f9f9f9;">
13+
<p style="margin-top: 0;">{{ sharer_message }}</p>
14+
<button class="strong-button" style="border-radius: 4px;">
15+
<a href="{{ accept_link }}" style="color: white;">Open</a>
16+
</button>
17+
</div>
18+
{% else %}
1219
<button class="strong-button" style="border-radius: 4px;">
1320
<a href="{{ accept_link }}" style="color: white;">Open</a>
1421
</button>
22+
{% endif %}
1523
</p>
1624

1725
<p>Please don't hesitate to contact us at {{ product.support_email }} if you need further help.</p>

packages/notifications-library/src/notifications_library/templates/on_share_project.email.content.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,9 @@ Dear {{ user.first_name }},
22

33
Great news! {{ sharer_username }} has shared a {{ resource_alias }} with you on {{ product.display_name }}.
44

5-
To view the {{ resource_alias }} and accept the sharing, simply click the link below:
5+
To view the {{ resource_alias }} and accept the sharing, follow below:
66

7+
{{ sharer_message }}
78
{{ accept_link }}
89

910
Please don't hesitate to contact us at {{ product.support_email }} if you need further help.

packages/notifications-library/tests/email/test_email_events.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,7 @@ def event_extra_data( # noqa: PLR0911
140140
"host": host_url,
141141
"resource_alias": "Project",
142142
"sharer_username": "sharer_username",
143+
"sharer_message": faker.paragraph(nb_sentences=2),
143144
"accept_link": f"{host_url}?code={code}",
144145
}
145146
case "on_unregister":

0 commit comments

Comments
 (0)