Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

emails: update templates #1049

Merged
merged 2 commits into from
Oct 25, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -2,42 +2,70 @@
{% set receiver = invitation_request.receiver %}
{% set community = invitation_request.created_by %}
{% set request_id = invitation_request.id %}

{% set message = notification.context.message | safe if notification.context.message else '' %}
{% set community_title = community.metadata.title %}
{% set receiver_name = receiver.profile.full_name or receiver.username %}
{% set receiver_name = receiver.username or receiver.profile.full_name %}
0einstein0 marked this conversation as resolved.
Show resolved Hide resolved

{# TODO: use request.links.self_html when issue issue is resolved: https://github.com/inveniosoftware/invenio-rdm-records/issues/1327 #}
{% set request_link = "{ui}/me/requests/{id}".format(
ui=config.SITE_UI_URL, id=request_id
)
%}
{% set account_settings_link = "{ui}/account/settings/notifications".format(
ui=config.SITE_UI_URL
)
%}

{%- block subject -%}
{{ _("Community member invitation accepted") }}
{{ _("✅ @{user_name} accepted the invitation to join community '{community_title}'.").format(user_name=receiver_name, community_title=community_title) }}
{%- endblock subject -%}

{%- block html_body -%}
<p>
{{ _("'{user_name}' accepted the invitation to join community '{community_title}'.").format(user_name=receiver_name, community_title=community_title) }}
</p>

<a href="{{ request_link }}" class="button"> {{ _("Check out the invitation") }}</a>
<table style="font-family:'Lato',Helvetica,Arial,sans-serif;border-spacing:15px">
<tr>
<td>{{ _("<b>@{user_name}</b> accepted the invitation to join your community <b>{community_title}</b>").format(user_name=receiver_name,community_title=community_title) }}
0einstein0 marked this conversation as resolved.
Show resolved Hide resolved
{% if message %}
{{ _(" with the following message:")}}
{% endif %}
</td>
</tr>
<tr>
{% if message %}
<td><em>"{{message}}"</em></td>
{% endif %}
</tr>
<tr>
<td><a href="{{ request_link }}" class="button">{{ _("Check out the invitation")}}</a></td>
</tr>
<tr>
<td><strong>_</strong></td>
</tr>
<tr>
<td style="font-size:smaller">{{ _("This is an auto-generated message. To manage notifications, visit your")}} <a href="{{account_settings_link}}">{{ _("account settings")}}</a>.</td>
</tr>
</table>
{%- endblock html_body %}

{%- block plain_body -%}
{{ _("'{user_name}' accepted the invitation to join community '{community_title}'.").format(user_name=receiver_name, community_title=community_title) }}
{{ _("@{user_name} accepted the invitation to join your community '{community_title}'").format(user_name=receiver_name,community_title=community_title) }}

{% if message %}
{{ _("with the following message:")}}
{{message}}
{% endif %}

{{ _("Check out the invitation:") }} {{ request_link }}
{%- endblock plain_body %}

{# Markdown for Slack/Mattermost/chat #}
{%- block md_body -%}
{{ _("*{user_name}* accepted the invitation to join community *{community_title}*.").format(user_name=receiver_name, community_title=community_title) }}
{{ _("*@{user_name}* accepted the invitation to join your community *{community_title}*").format(user_name=receiver_name,community_title=community_title) }}

{% if message %}
{{ _("with the following message:")}}
{{message}}
{% endif %}

{%- if message %}
{{ _("Invitation message:") }}
{{ message }}
{%- endif %}

[{{ _("Check out the invitation") }}]({{ request_link }})
{%- endblock md_body %}
Original file line number Diff line number Diff line change
Expand Up @@ -2,42 +2,69 @@
{% set receiver = invitation_request.receiver %}
{% set community = invitation_request.created_by %}
{% set request_id = invitation_request.id %}

{% set message = notification.context.message | safe if notification.context.message else '' %}
{% set community_title = community.metadata.title %}
{% set receiver_name = receiver.full_name or receiver.username %}
{% set receiver_name = receiver.username or receiver.profile.full_name %}
0einstein0 marked this conversation as resolved.
Show resolved Hide resolved

{# TODO: use request.links.self_html when issue issue is resolved: https://github.com/inveniosoftware/invenio-rdm-records/issues/1327 #}
{% set request_link = "{ui}/me/requests/{id}".format(
ui=config.SITE_UI_URL, id=request_id
)
%}
{% set account_settings_link = "{ui}/account/settings/notifications".format(
ui=config.SITE_UI_URL
)
%}

{%- block subject -%}
{{ _("Community member invitation cancelled") }}
{{ _("Community member invitation cancelled for @{user_name}").format(user_name=receiver_name) }}
{%- endblock subject -%}

{%- block html_body -%}
<p>
{{ _("The invitation to join community '{community_title}' was cancelled.").format(community_title=community_title) }}
</p>

<a href="{{ request_link }}" class="button"> {{ _("Check out the invitation") }}</a>
<table style="font-family:'Lato',Helvetica,Arial,sans-serif;border-spacing:15px">
<tr>
<td>{{ _("The invitation for <b>@{user_name}</b> to join community <b>{community_title}</b> was cancelled").format(user_name=receiver_name,community_title=community_title) }}
{% if message %}
{{ _(" with the following message:")}}
{% endif %}
</td>
</tr>
<tr>
{% if message %}
<td><em>"{{message}}"</em></td>
{% endif %}
</tr>
<tr>
<td><a href="{{ request_link }}" class="button">{{ _("Check out the invitation")}}</a></td>
</tr>
<tr>
<td><strong>_</strong></td>
</tr>
<tr>
<td style="font-size:smaller">{{ _("This is an auto-generated message. To manage notifications, visit your")}} <a href="{{account_settings_link}}">{{ _("account settings")}}</a>.</td>
</tr>
</table>
{%- endblock html_body %}

{%- block plain_body -%}
{{ _("The invitation to join community '{community_title}' was cancelled.").format(community_title=community_title) }}
{{ _("The invitation for @{user_name} to join your community '{community_title}' was cancelled").format(user_name=receiver_name,community_title=community_title) }}

{% if message %}
{{ _("with the following message:")}}
{{message}}
{% endif %}

{{ _("Check out the invitation:") }} {{ request_link }}
{%- endblock plain_body %}

{# Markdown for Slack/Mattermost/chat #}
{%- block md_body -%}
{{ _("The invitation to join community *{community_title}* was cancelled.").format(community_title=community_title) }}
{{ _("The invitation for *@{user_name}* to join your community *'{community_title}'* was cancelled").format(user_name=receiver_name,community_title=community_title) }}

{%- if message %}
{{ _("Invitation message:") }}
{{ message }}
{%- endif %}
{% if message %}
{{ _("with the following message:")}}
{{message}}
{% endif %}

[{{ _("Check out the invitation") }}]({{ request_link }})
{%- endblock md_body %}
Original file line number Diff line number Diff line change
Expand Up @@ -2,42 +2,69 @@
{% set receiver = invitation_request.receiver %}
{% set community = invitation_request.created_by %}
{% set request_id = invitation_request.id %}

{% set message = notification.context.message | safe if notification.context.message else '' %}
{% set community_title = community.metadata.title %}
{% set receiver_name = receiver.profile.full_name or receiver.username %}
{% set receiver_name = receiver.username or receiver.profile.full_name %}

{# TODO: use request.links.self_html when issue issue is resolved: https://github.com/inveniosoftware/invenio-rdm-records/issues/1327 #}
{% set request_link = "{ui}/me/requests/{id}".format(
ui=config.SITE_UI_URL, id=request_id
)
%}
{% set account_settings_link = "{ui}/account/settings/notifications".format(
ui=config.SITE_UI_URL
)
%}

{%- block subject -%}
{{ _("Community member invitation declined") }}
{{ _("⛔️ @{user_name} declined the invitation to join '{community_title}'").format(user_name=receiver_name, community_title=community_title) }}
{%- endblock subject -%}

{%- block html_body -%}
<p>
{{ _("'{user_name}' declined the invitation to join community '{community_title}'.").format(user_name=receiver_name, community_title=community_title) }}
</p>

<a href="{{ request_link }}" class="button"> {{ _("Check out the invitation") }}</a>
<table style="font-family:'Lato',Helvetica,Arial,sans-serif;border-spacing:15px">
<tr>
<td>{{ _("<b>@{user_name}</b> declined the invitation to join your community <b>{community_title}</b>").format(user_name=receiver_name, community_title=community_title) }}
{% if message %}
{{ _(" with the following message:")}}
{% endif %}
</td>
</tr>
<tr>
{% if message %}
<td><em>"{{message}}"</em></td>
{% endif %}
</tr>
<tr>
<td><a href="{{ request_link }}" class="button">{{ _("Check out the invitation")}}</a></td>
</tr>
<tr>
<td><strong>_</strong></td>
</tr>
<tr>
<td style="font-size:smaller">{{ _("This is an auto-generated message. To manage notifications, visit your")}} <a href="{{account_settings_link}}">{{ _("account settings")}}</a>.</td>
</tr>
</table>
{%- endblock html_body %}

{%- block plain_body -%}
{{ _("'{user_name}' declined the invitation to join community '{community_title}'.").format(user_name=receiver_name, community_title=community_title) }}
{{ _("@{user_name} declined the invitation to join your community {community_title}").format(user_name=receiver_name, community_title=community_title) }}

{% if message %}
{{ _("with the following message:")}}
{{message}}
{% endif %}

{{ _("Check out the invitation:") }} {{ request_link }}
{%- endblock plain_body %}

{# Markdown for Slack/Mattermost/chat #}
{%- block md_body -%}
{{ _("*{user_name}* declined the invitation to join community *{community_title}*.").format(user_name=receiver_name, community_title=community_title) }}
{{ _("*@{user_name}* declined the invitation to join your community *{community_title}*").format(user_name=receiver_name, community_title=community_title) }}

{%- if message %}
{{ _("Invitation message:") }}
{{ message }}
{%- endif %}
{% if message %}
{{ _("with the following message:")}}
{{message}}
{% endif %}

[{{ _("Check out the invitation") }}]({{ request_link }})
{%- endblock md_body %}
Original file line number Diff line number Diff line change
Expand Up @@ -4,40 +4,48 @@
{% set request_id = invitation_request.id %}

{% set community_title = community.metadata.title %}
{% set receiver_name = receiver.profile.full_name or receiver.username %}
{% set receiver_name = receiver.username or receiver.profile.full_name %}

{# TODO: use request.links.self_html when issue issue is resolved: https://github.com/inveniosoftware/invenio-rdm-records/issues/1327 #}
{% set request_link = "{ui}/me/requests/{id}".format(
ui=config.SITE_UI_URL, id=request_id
)
%}
{% set account_settings_link = "{ui}/account/settings/notifications".format(
ui=config.SITE_UI_URL
)
%}

{%- block subject -%}
{{ _("Community member invitation expired") }}
{{ _("⌛️ The invitation for @{user_name} to join community '{community_title}' expired").format(user_name=receiver_name, community_title=community_title) }}
{%- endblock subject -%}

{%- block html_body -%}
<p>
{{ _("The invitation for '{user_name}' to join community '{community_title}' expired.").format(user_name=receiver_name, community_title=community_title) }}
</p>

<a href="{{ request_link }}" class="button"> {{ _("Check out the invitation") }}</a>
<table style="font-family:'Lato',Helvetica,Arial,sans-serif;border-spacing:15px">
<tr>
<td>{{ _("The invitation for <b>@{user_name}</b> to join community <b>{community_title}</b> has expired.").format(user_name=receiver_name, community_title=community_title) }}</td>
</tr>
<tr>
<td><a href="{{ request_link }}" class="button">{{ _("Check out the invitation")}}</a></td>
</tr>
<tr>
<td><strong>_</strong></td>
</tr>
<tr>
<td style="font-size:smaller">{{ _("This is an auto-generated message. To manage notifications, visit your")}} <a href="{{account_settings_link}}">{{ _("account settings")}}</a>.</td>
</tr>
</table>
{%- endblock html_body %}

{%- block plain_body -%}
{{ _("The invitation for '{user_name}' to join community '{community_title}' expired.").format(user_name=receiver_name, community_title=community_title) }}
{{ _("The invitation for @{user_name} to join community '{community_title}' has expired.").format(user_name=receiver_name, community_title=community_title) }}

{{ _("Check out the invitation:") }} {{ request_link }}
{%- endblock plain_body %}

{# Markdown for Slack/Mattermost/chat #}
{%- block md_body -%}
{{ _("The invitation for *{user_name}* to join community *{community_title}* expired.").format(user_name=receiver_name, community_title=community_title) }}

{%- if message %}
{{ _("Invitation message:") }}
{{ message }}
{%- endif %}
{{ _("The invitation for *@{user_name}* to join community *{community_title}* has expired.").format(user_name=receiver_name, community_title=community_title) }}

[{{ _("Check out the invitation") }}]({{ request_link }})
{%- endblock md_body %}
Original file line number Diff line number Diff line change
Expand Up @@ -12,45 +12,60 @@
ui=config.SITE_UI_URL, id=request_id
)
%}
{% set account_settings_link = "{ui}/account/settings/notifications".format(
ui=config.SITE_UI_URL
)
%}

{%- block subject -%}
{{ _("New invitation to join community '{community_title}' as '{role}'.").format(community_title=community_title, role=role) }}
{{ _("📬 New invitation to join the community '{community_title}' as '{role}'").format(community_title=community_title, role=role) }}
{%- endblock subject -%}

{%- block html_body -%}
<p>
{{ _("You have been invited to join community '{community_title}' as '{role}'.").format(community_title=community_title, role=role) }}
</p>

{%- if message %}
<p>
{{ _("Invitation message:") }}
{{ message }}
</p>
{%- endif %}

<a href="{{ request_link }}" class="button"> {{ _("Check out the invitation") }}</a>
<table style="font-family:'Lato',Helvetica,Arial,sans-serif;border-spacing:15px">
<tr>
<td>{{ _("You have been invited to join community <b>{community_title}</b> as <b>{role}</b>").format(community_title=community_title, role=role) }}
{% if message %}
{{ _(" with the following message:")}}
{% endif %}
</td>
</tr>
<tr>
{% if message %}
<td><em>"{{message}}"</em></td>
{% endif %}
</tr>
<tr>
<td><a href="{{ request_link }}" class="button">{{ _("Check out the invitation")}}</a></td>
</tr>
<tr>
<td><strong>_</strong></td>
</tr>
<tr>
<td style="font-size:smaller">{{ _("This is an auto-generated message. To manage notifications, visit your")}} <a href="{{account_settings_link}}">{{ _("account settings")}}</a>.</td>
</tr>
</table>
{%- endblock html_body %}

{%- block plain_body -%}
{{ _("You have been invited to join community '{community_title}' as '{role}'.").format(community_title=community_title, role=role) }}
{{ _("You have been invited to join community '{community_title}' as '{role}'").format(community_title=community_title, role=role) }}

{%- if message %}
{{ _("Invitation message:") }}
{{ message }}
{%- endif %}
{% if message %}
{{ _("with the following message:")}}
{{message}}
{% endif %}

{{ _("Check out the invitation:") }} {{ request_link }}
{%- endblock plain_body %}

{# Markdown for Slack/Mattermost/chat #}
{%- block md_body -%}
{{ _("You have been invited to join community *{community_title}* as *{role}*.").format(community_title=community_title, role=role) }}
{{ _("You have been invited to join community *{community_title}* as *{role}*").format(community_title=community_title, role=role) }}

{%- if message %}
{{ _("Invitation message:") }}
{{ message }}
{%- endif %}
{% if message %}
{{ _("with the following message:")}}
{{message}}
{% endif %}

[{{ _("Check out the invitation") }}]({{ request_link }})
{%- endblock md_body %}
Loading
Loading