-
Notifications
You must be signed in to change notification settings - Fork 71
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Custom properties in liquid template.
- Loading branch information
1 parent
534ec69
commit 86cfa08
Showing
9 changed files
with
236 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
94 changes: 94 additions & 0 deletions
94
backend/tests/Notifo.Domain.Tests/Channels/Email/CustomHtml.liquid.mjml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,94 @@ | ||
<mjml> | ||
<mj-body> | ||
<mj-section> | ||
<mj-column width="30%"> | ||
<mj-image align="left" alt="Logo" src="https://raw.githubusercontent.com/notifo-io/notifo/main/backend/src/Notifo/wwwroot/acme.png" padding="15px" /> | ||
</mj-column> | ||
</mj-section> | ||
<mj-section> | ||
<mj-column> | ||
<mj-text font-size="20px" font-family="Open Sans" padding-left="15px" padding-bottom="0">Your Notifications</mj-text> | ||
</mj-column> | ||
</mj-section> | ||
<mj-wrapper background-color="white" padding="15px"> | ||
<mj-section padding="0 0 10px 0"> | ||
<mj-column> | ||
<mj-text font-family="Open Sans" font-size="16px" padding-left="0">Hello {{ user.fullname | default: 'User' }}</mj-text> | ||
<mj-text font-family="Open Sans" font-size="14px" padding-left="0" padding-bottom="0">We have some notifications from {{ app.name }} for you.</mj-text> | ||
</mj-column> | ||
</mj-section> | ||
|
||
{% for notification in notifications %} | ||
{% if notification.imageSmall %} | ||
{% assign width = "84%" %} | ||
{% else %} | ||
{% assign width = "100%" %} | ||
{% endif %} | ||
<mj-section padding="10px 0 0 0"> | ||
<mj-group> | ||
<mj-column width="{{ width }}"> | ||
<mj-text font-family="Open Sans" font-size="16px" font-weight="bold" padding="0px 10px 10px 0px">{{ notification.subject }}</mj-text> | ||
{% if notification.body %} | ||
<mj-text font-family="Open Sans" font-size="14px" padding="0px 0px 5px 0px">{{ notification.body }}</mj-text> | ||
{% endif %} | ||
{% if notification.children.size > 0 %} | ||
<mj-text font-family="Open Sans" font-size="14px" padding="0px 0px 5px 0px">+ {{ notification.children.size }} more</mj-text> | ||
{% endif %} | ||
{% if notification.linkUrl and notification.linkText %} | ||
<mj-text font-family="Open Sans" font-size="14px" padding="10px 0px 5px 0px"> | ||
<a href="{{ notification.linkUrl }}">{{ notification.linkText }}</a> | ||
</mj-text> | ||
{% endif %} | ||
|
||
<mj-text font-family="Open Sans" font-size="14px" padding="10px 0px 5px 0px"> | ||
{{ notification.properties.myProperty1 }} | ||
</mj-text> | ||
</mj-column> | ||
{% if notification.imageSmall %} | ||
<mj-column width="16%"> | ||
<mj-image src="{{ notification.imageSmall }}" padding="0px 10px 0px 0px" /> | ||
</mj-column> | ||
{% endif %} | ||
</mj-group> | ||
</mj-section> | ||
{% if notification.confirmUrl and notification.confirmText %} | ||
<mj-section padding-top="6px"> | ||
<mj-column> | ||
<mj-button align="left" background-color="#175DA8" border-radius="4px" font-family="Open Sans" font-size="16px" padding="0px" href="{{ notification.confirmUrl }}">{{ notification.confirmText }}</mj-button> | ||
</mj-column> | ||
</mj-section> | ||
{% endif %} | ||
<mj-section padding="0"> | ||
<mj-column> | ||
<mj-divider padding="5px" border-color="#ddd" border-width="1px" /> | ||
</mj-column> | ||
</mj-section> | ||
{% endfor %} | ||
|
||
<mj-section padding="0"> | ||
<mj-column> | ||
<mj-text font-family="Open Sans" font-size="14px" padding-left="0">Best regards,</mj-text> | ||
<mj-text font-family="Open Sans" font-size="14px" padding-left="0">Your {{ app.name }} team.</mj-text> | ||
</mj-column> | ||
</mj-section> | ||
</mj-wrapper> | ||
<mj-section> | ||
<mj-column> | ||
<mj-social font-family="Open Sans" font-size="15px" icon-size="20px" mode="horizontal"> | ||
<mj-social-element name="facebook" href="https://notifo.io/">Facebook</mj-social-element> | ||
<mj-social-element name="google" href="https://notifo.io/">Google</mj-social-element> | ||
<mj-social-element name="twitter" href="https://notifo.io/">Twitter</mj-social-element> | ||
</mj-social> | ||
</mj-column> | ||
</mj-section> | ||
<mj-section padding-top="10px"> | ||
<mj-column> | ||
<mj-text font-family="Open Sans" font-size="12px" padding="4px" align="center" text-decoration="underline"> | ||
<a style="color: inherit" href="{{ preferencesUrl }}">Email Preferences</a> | ||
</mj-text> | ||
<mj-text font-family="Open Sans" font-size="12px" padding="4px" align="center">Acme Corporation, Inc.</mj-text> | ||
<mj-text font-family="Open Sans" font-size="12px" padding="4px" align="center">New York City, United Stated</mj-text> | ||
</mj-column> | ||
</mj-section> | ||
</mj-body> | ||
</mjml> |
1 change: 1 addition & 0 deletions
1
backend/tests/Notifo.Domain.Tests/Channels/Email/CustomSubject.text
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Your notifications from {{ app.name }} |
31 changes: 31 additions & 0 deletions
31
backend/tests/Notifo.Domain.Tests/Channels/Email/CustomText.liquid.text
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
Your Notifications, | ||
|
||
Hello {{ user.displayName | default: 'User' }} | ||
|
||
We have some notifications from {{ app.name }} for you. | ||
|
||
{% for notification in notifications %} | ||
{{ notification.subject }} | ||
{% if notification.body %} | ||
{{ notification.body }} | ||
{% endif %} | ||
Custom: {{ notification.properties.myProperty1 }} | ||
{% if notification.confirmUrl and notification.confirmText -%} | ||
... | ||
Click this link to confirm this notification: {{ notification.confirmUrl }} | ||
{% endif -%} | ||
{% if notification.linkText and notification.linkUrl -%} | ||
... | ||
{{ notification.linkUrl }} | {{ notification.linkText }} | ||
{% endif -%} | ||
{% if notification.children.size > 0 %} | ||
+ { notification.children.size } more | ||
{% endif %} | ||
-- | ||
{% endfor -%} | ||
|
||
Best regards, | ||
|
||
Your {{ app.name }} team. | ||
|
||
Use the following link to change your email preferences: {{ preferencesUrl }} |
Oops, something went wrong.