diff --git a/templates/semantic-ui/invenio_notifications/comment-request-event.create.jinja b/templates/semantic-ui/invenio_notifications/comment-request-event.create.jinja index ebc11cd..abd5ad4 100644 --- a/templates/semantic-ui/invenio_notifications/comment-request-event.create.jinja +++ b/templates/semantic-ui/invenio_notifications/comment-request-event.create.jinja @@ -1,76 +1,92 @@ -{% set _invenio_request = notification.context.request %} -{% set _invenio_request_event = notification.context.request_event %} +{% set invenio_request = notification.context.request %} +{% set invenio_request_event = notification.context.request_event %} + +{# created_by is either a resolved user or an email (for guests) #} +{% set event_creator_name = invenio_request_event.created_by.username or invenio_request_event.created_by %} +{% set request_id = invenio_request.id %} +{% set request_event_content = invenio_request_event.payload.content | safe %} +{% set request_title = invenio_request.title | safe %} +{% if recipient.data.profile %} + {% set recipient_full_name = recipient.data.profile.full_name | safe %} +{% else %} + {% set recipient_full_name = recipient.data.email | safe %} +{% endif %} {% set help_url = config.CDS_SERVICE_ELEMENT_URL %} -{% set recipient_full_name = recipient.data.profile.full_name %} -{% set event_creator_full_name = _invenio_request_event.created_by.profile.full_name %} -{% set request_id = _invenio_request.id %} -{% set request_event_content = _invenio_request_event.payload.content | safe %} -{% set request_title = _invenio_request.title | safe %} {# 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 ) %} - -{%- block subject -%} -[CDS] New comment on "{{ request_title }}" -{%- endblock subject -%} - {% set account_settings_link = "{ui}/account/settings/notifications".format( ui=config.SITE_UI_URL ) %} -{%- block html_body -%} -

Dear {{ recipient_full_name }},

- -

{{ event_creator_full_name }} commented on "{{ request_title }}":

- -{{ request_event_content }} - -

You can access the request here: {{ request_link }}

- -Best regards,
---
-CERN Document Server {{ config.SITE_UI_URL }}
-Need help? {{ help_url }}

+{%- block subject -%} + [CDS] {{ _("πŸ’¬ New comment on '{request_title}'").format(request_title=request_title) }} +{%- endblock subject -%} ---
-

This is an auto-generated message. To manage notifications, visit your account settings.

-{%- endblock html_body -%} +{%- block html_body -%} + + + + + + + + + + + + + + + + + + + +
{{ _("Dear {recipient}").format(recipient=recipient_full_name) }}, +
{{ _("'@{user_name}' commented on '{request_title}':").format(user_name=event_creator_name, request_title=request_title) }}
{{ request_event_content }}
{{ _("Check out the request")}}
+ {{ _("Best regards") }},
+ --
+ CERN Document Server {{ config.SITE_UI_URL }}
+ {{ _("Need help?") }} {{ help_url }} +
{{ _("This is an auto-generated message. To manage notifications, visit your")}} {{ _("account settings")}}.
+{%- endblock html_body %} {%- block plain_body -%} -Dear {{ recipient_full_name }}, +{{ _("Dear {recipient}").format(recipient=recipient_full_name) }}, -{{ event_creator_full_name }} commented on "{{ request_title }}": +{{ _("@{user_name} commented on '{request_title}'").format(user_name=event_creator_name, request_title=request_title) }}. {{ request_event_content }} -You can access the request here: <{{ request_link }}> +{{ _("Check out the request: {request_link}".format(request_link=request_link)) }} -Best regards, +{{ _("Best regards") }}, -- -CERN Document Server <{{ config.SITE_UI_URL }}> -Need help? <{{ help_url }}> +CERN Document Server {{ _("{site_url}").format(site_url=config.SITE_UI_URL) }} +{{ _("Need help? {help_url}".format(help_url=help_url)) }} -This is an auto-generated message. To manage notifications, visit your account settings <{{ account_settings_link }}>. +{{ _("This is an auto-generated message. To manage notifications, visit your account settings {account_settings_link}.".format(account_settings_link=account_settings_link))}} {%- endblock plain_body %} {# Markdown for Slack/Mattermost/chat #} {%- block md_body -%} -Dear {{ recipient_full_name }}, +{{ _("Dear {recipient}").format(recipient=recipient_full_name) }}, -{{ event_creator_full_name }} commented on *{{ request_title }}*: +{{ _("*@{user_name}* commented on *{request_title}*").format(user_name=event_creator_name, request_title=request_title) }}. {{ request_event_content }} -You can access the request here: <{{ request_link }}> +[{{ _("Check out the request") }}]({{ request_link }}) -Best regards, +{{ _("Best regards") }}, -- -CERN Document Server <{{ config.SITE_UI_URL }}> -Need help? <{{ help_url }}> +CERN Document Server {{ _("{site_url}").format(site_url=config.SITE_UI_URL) }} +{{ _("Need help? {help_url}".format(help_url=help_url)) }} -This is an auto-generated message. To manage notifications, visit your account settings <{{ account_settings_link }}>. +{{ _("This is an auto-generated message. To manage notifications, visit your account settings {account_settings_link}.".format(account_settings_link=account_settings_link))}} {%- endblock md_body -%} diff --git a/templates/semantic-ui/invenio_notifications/community-invitation.accept.jinja b/templates/semantic-ui/invenio_notifications/community-invitation.accept.jinja new file mode 100644 index 0000000..3f76be1 --- /dev/null +++ b/templates/semantic-ui/invenio_notifications/community-invitation.accept.jinja @@ -0,0 +1,100 @@ +{% set invitation_request = notification.context.request %} +{% 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.username or receiver.profile.full_name %} +{% set recipient_full_name = recipient.data.profile.full_name %} +{% set help_url = config.CDS_SERVICE_ELEMENT_URL %} + +{# 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 -%} + [CDS] {{ _("βœ… @{user_name} accepted the invitation to join community '{community_title}'.").format(user_name=receiver_name, community_title=community_title) }} +{%- endblock subject -%} + +{%- block html_body -%} + + + + + + + + + {% if message %} + + + + {% endif %} + + + + + + + + + +
{{ _("Dear {recipient}").format(recipient=recipient_full_name) }}, +
{{ _("'@{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:")}} + {% endif %} +
"{{message}}"
{{ _("Check out the invitation")}}
+ {{ _("Best regards") }},
+ --
+ CERN Document Server {{ config.SITE_UI_URL }}
+ {{ _("Need help?") }} {{ help_url }} +
{{ _("This is an auto-generated message. To manage notifications, visit your")}} {{ _("account settings")}}.
+{%- endblock html_body %} + +{%- block plain_body -%} +{{ _("Dear {recipient}").format(recipient=recipient_full_name) }}, + +{{ _("@{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}".format(request_link=request_link)) }} + +{{ _("Best regards") }}, +-- +CERN Document Server {{ _("<{site_url}>").format(site_url=config.SITE_UI_URL) }} +{{ _("Need help? <{help_url}>".format(help_url=help_url)) }} + +{{ _("This is an auto-generated message. To manage notifications, visit your account settings {account_settings_link}.".format(account_settings_link=account_settings_link))}} +{%- endblock plain_body %} + +{# Markdown for Slack/Mattermost/chat #} +{%- block md_body -%} +{{ _("Dear {recipient}").format(recipient=recipient_full_name) }}, + +{{ _("@{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}".format(request_link=request_link)) }} + +{{ _("Best regards") }}, +-- +CERN Document Server {{ _("<{site_url}>").format(site_url=config.SITE_UI_URL) }} +{{ _("Need help? <{help_url}>".format(help_url=help_url)) }} + +{{ _("This is an auto-generated message. To manage notifications, visit your account settings {account_settings_link}.".format(account_settings_link=account_settings_link))}} +{%- endblock md_body %} \ No newline at end of file diff --git a/templates/semantic-ui/invenio_notifications/community-invitation.cancel.jinja b/templates/semantic-ui/invenio_notifications/community-invitation.cancel.jinja new file mode 100644 index 0000000..11b372c --- /dev/null +++ b/templates/semantic-ui/invenio_notifications/community-invitation.cancel.jinja @@ -0,0 +1,99 @@ +{% set invitation_request = notification.context.request %} +{% 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.username or receiver.profile.full_name %} +{% set recipient_full_name = recipient.data.profile.full_name %} +{% set help_url = config.CDS_SERVICE_ELEMENT_URL %} + +{# 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 -%} + [CDS] {{ _("❌ Community member invitation cancelled for @{user_name}").format(user_name=receiver_name) }} +{%- endblock subject -%} + +{%- block html_body -%} + + + + + + + + {% if message %} + + + + {% endif %} + + + + + + + + + +
{{ _("Dear {recipient}").format(recipient=recipient_full_name) }}, +
{{ _("The invitation for '@{user_name}' to join community '{community_title}' was cancelled").format(user_name=receiver_name,community_title=community_title) }} + {% if message %} + {{ _(" with the following message:")}} + {% endif %} +
"{{message}}"
{{ _("Check out the invitation")}}
+ {{ _("Best regards") }},
+ --
+ CERN Document Server {{ config.SITE_UI_URL }}
+ {{ _("Need help?") }} {{ help_url }} +
{{ _("This is an auto-generated message. To manage notifications, visit your")}} {{ _("account settings")}}.
+{%- endblock html_body %} + +{%- block plain_body -%} +{{ _("Dear {recipient}").format(recipient=recipient_full_name) }}, + +{{ _("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}".format(request_link=request_link)) }} + +{{ _("Best regards") }}, +-- +CERN Document Server {{ _("<{site_url}>").format(site_url=config.SITE_UI_URL) }} +{{ _("Need help? <{help_url}>".format(help_url=help_url)) }} + +{{ _("This is an auto-generated message. To manage notifications, visit your account settings {account_settings_link}.".format(account_settings_link=account_settings_link))}} +{%- endblock plain_body %} + +{# Markdown for Slack/Mattermost/chat #} +{%- block md_body -%} +{{ _("Dear {recipient}").format(recipient=recipient_full_name) }}, + +{{ _("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}".format(request_link=request_link)) }} + +{{ _("Best regards") }}, +-- +CERN Document Server {{ _("<{site_url}>").format(site_url=config.SITE_UI_URL) }} +{{ _("Need help? <{help_url}>".format(help_url=help_url)) }} + +{{ _("This is an auto-generated message. To manage notifications, visit your account settings {account_settings_link}.".format(account_settings_link=account_settings_link))}} +{%- endblock md_body %} diff --git a/templates/semantic-ui/invenio_notifications/community-invitation.decline.jinja b/templates/semantic-ui/invenio_notifications/community-invitation.decline.jinja new file mode 100644 index 0000000..4cb9362 --- /dev/null +++ b/templates/semantic-ui/invenio_notifications/community-invitation.decline.jinja @@ -0,0 +1,99 @@ +{% set invitation_request = notification.context.request %} +{% 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.username or receiver.profile.full_name %} +{% set recipient_full_name = recipient.data.profile.full_name %} +{% set help_url = config.CDS_SERVICE_ELEMENT_URL %} + +{# 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 -%} + [CDS] {{ _("⛔️ @{user_name} declined the invitation to join '{community_title}'").format(user_name=receiver_name, community_title=community_title) }} +{%- endblock subject -%} + +{%- block html_body -%} + + + + + + + + {% if message %} + + + + {% endif %} + + + + + + + + + +
{{ _("Dear {recipient}").format(recipient=recipient_full_name) }}, +
{{ _("'@{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:")}} + {% endif %} +
"{{message}}"
{{ _("Check out the invitation")}}
+ {{ _("Best regards") }},
+ --
+ CERN Document Server {{ config.SITE_UI_URL }}
+ {{ _("Need help?") }} {{ help_url }} +
{{ _("This is an auto-generated message. To manage notifications, visit your")}} {{ _("account settings")}}.
+{%- endblock html_body %} + +{%- block plain_body -%} +{{ _("Dear {recipient}").format(recipient=recipient_full_name) }}, + +{{ _("@{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}".format(request_link=request_link)) }} + +{{ _("Best regards") }}, +-- +CERN Document Server {{ _("{site_url}").format(site_url=config.SITE_UI_URL) }} +{{ _("Need help? {help_url}".format(help_url=help_url)) }} + +{{ _("This is an auto-generated message. To manage notifications, visit your account settings {account_settings_link}.".format(account_settings_link=account_settings_link))}} +{%- endblock plain_body %} + +{# Markdown for Slack/Mattermost/chat #} +{%- block md_body -%} +{{ _("Dear {recipient}").format(recipient=recipient_full_name) }}, + +{{ _("*@{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}".format(request_link=request_link)) }} + +{{ _("Best regards") }}, +-- +CERN Document Server {{ _("{site_url}").format(site_url=config.SITE_UI_URL) }} +{{ _("Need help? {help_url}".format(help_url=help_url)) }} + +{{ _("This is an auto-generated message. To manage notifications, visit your account settings {account_settings_link}.".format(account_settings_link=account_settings_link))}} +{%- endblock md_body %} diff --git a/templates/semantic-ui/invenio_notifications/community-invitation.expire.jinja b/templates/semantic-ui/invenio_notifications/community-invitation.expire.jinja new file mode 100644 index 0000000..654f0c3 --- /dev/null +++ b/templates/semantic-ui/invenio_notifications/community-invitation.expire.jinja @@ -0,0 +1,80 @@ +{% set invitation_request = notification.context.request %} +{% set receiver = invitation_request.receiver %} +{% set community = invitation_request.created_by %} +{% set request_id = invitation_request.id %} + +{% set community_title = community.metadata.title %} +{% set receiver_name = receiver.username or receiver.profile.full_name %} +{% set recipient_full_name = recipient.data.profile.full_name %} +{% set help_url = config.CDS_SERVICE_ELEMENT_URL %} + +{# 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 -%} + [CDS] {{ _("βŒ›οΈ 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 -%} + + + + + + + + + + + + + + + + +
{{ _("Dear {recipient}").format(recipient=recipient_full_name) }}, +
{{ _("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")}}
+ {{ _("Best regards") }},
+ --
+ CERN Document Server {{ config.SITE_UI_URL }}
+ {{ _("Need help?") }} {{ help_url }} +
{{ _("This is an auto-generated message. To manage notifications, visit your")}} {{ _("account settings")}}.
+{%- endblock html_body %} + +{%- block plain_body -%} +{{ _("Dear {recipient}").format(recipient=recipient_full_name) }}, + +{{ _("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}".format(request_link=request_link)) }} + +{{ _("Best regards") }}, +-- +CERN Document Server {{ _("{site_url}").format(site_url=config.SITE_UI_URL) }} +{{ _("Need help? {help_url}".format(help_url=help_url)) }} + +{{ _("This is an auto-generated message. To manage notifications, visit your account settings {account_settings_link}.".format(account_settings_link=account_settings_link))}} +{%- endblock plain_body %} + +{# Markdown for Slack/Mattermost/chat #} +{%- block md_body -%} +{{ _("Dear {recipient}").format(recipient=recipient_full_name) }}, + +{{ _("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 }}) + +{{ _("Best regards") }}, +-- +CERN Document Server {{ _("{site_url}").format(site_url=config.SITE_UI_URL) }} +{{ _("Need help? {help_url}".format(help_url=help_url)) }} + +{{ _("This is an auto-generated message. To manage notifications, visit your account settings {account_settings_link}.".format(account_settings_link=account_settings_link))}} +{%- endblock md_body %} diff --git a/templates/semantic-ui/invenio_notifications/community-invitation.submit.jinja b/templates/semantic-ui/invenio_notifications/community-invitation.submit.jinja index b912e92..68ec930 100644 --- a/templates/semantic-ui/invenio_notifications/community-invitation.submit.jinja +++ b/templates/semantic-ui/invenio_notifications/community-invitation.submit.jinja @@ -1,11 +1,13 @@ -{% set _invitation_request = notification.context.request %} -{% set _community = _invitation_request.created_by %} -{% set request_id = _invitation_request.id %} -{% set recipient_full_name = recipient.data.profile.full_name %} -{% set community_title = _community.metadata.title %} -{% set help_url = config.CDS_SERVICE_ELEMENT_URL %} +{% set invitation_request = notification.context.request %} +{% set receiver = invitation_request.receiver %} +{% set community = invitation_request.created_by %} +{% set request_id = invitation_request.id %} + +{% set community_title = community.metadata.title %} {% set message = notification.context.message | safe if notification.context.message else '' %} {% set role = notification.context.role %} +{% set recipient_full_name = recipient.data.profile.full_name %} +{% set help_url = config.CDS_SERVICE_ELEMENT_URL %} {# 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( @@ -18,73 +20,81 @@ %} {%- block subject -%} -[CDS] New invitation to join community "{{ community_title }}" as "{{ role }}" + [CDS] {{ _("πŸ“¬ New invitation to join the community '{community_title}' as '{role}'").format(community_title=community_title, role=role) }} {%- endblock subject -%} {%- block html_body -%} -

Dear {{ recipient_full_name }},

- -

You have been invited to join community "{{community_title}}" as "{{role}}".

- -{%- if message %} -

- Invitation message: - {{ message }} -

-{%- endif %} - -

You can access the invitation here: {{ request_link }}

- -Best regards,
---
-CERN Document Server {{ config.SITE_UI_URL }}
-Need help? {{ help_url }}

- ---
-

This is an auto-generated message. To manage notifications, visit your account settings.

-{%- endblock html_body -%} + + + + + + + + {% if message %} + + + + {% endif %} + + + + + + + + + +
{{ _("Dear {recipient}").format(recipient=recipient_full_name) }}, +
{{ _("You have been invited to join community '{community_title}' as '{role}'").format(community_title=community_title, role=role) }} + {% if message %} + {{ _(" with the following message:")}} + {% endif %} +
"{{message}}"
{{ _("Check out the invitation")}}
+ {{ _("Best regards") }},
+ --
+ CERN Document Server {{ config.SITE_UI_URL }}
+ {{ _("Need help?") }} {{ help_url }} +
{{ _("This is an auto-generated message. To manage notifications, visit your")}} {{ _("account settings")}}.
+{%- endblock html_body %} {%- block plain_body -%} -Dear {{ recipient_full_name }}, - -You have been invited to join community "{{ community_title }}" as "{{ role }}". +{{ _("Dear {recipient}").format(recipient=recipient_full_name) }}, -{%- if message %} +{{ _("You have been invited to join community '{community_title}' as '{role}'").format(community_title=community_title, role=role) }} +{% if message %} -Invitation message: -{{ message }} +{{ _("with the following message:")}} +{{message}} -{%- endif %} +{% endif %} +{{ _("Check out the invitation: {request_link}".format(request_link=request_link)) }} -You can access the invitation request here: <{{ request_link }}> - -Best regards, +{{ _("Best regards") }}, -- -CERN Document Server <{{ config.SITE_UI_URL }}> -Need help? <{{ help_url }}> +CERN Document Server {{ _("{site_url}").format(site_url=config.SITE_UI_URL) }} +{{ _("Need help? {help_url}".format(help_url=help_url)) }} -This is an auto-generated message. To manage notifications, visit your account settings <{{ account_settings_link }}>. +{{ _("This is an auto-generated message. To manage notifications, visit your account settings {account_settings_link}.".format(account_settings_link=account_settings_link))}} {%- endblock plain_body %} {# Markdown for Slack/Mattermost/chat #} {%- block md_body -%} -Dear {{ recipient_full_name }}, - -You have been invited to join community *{{ community_title }}* as *{{ role }}*. - -{%- if message %} +{{ _("Dear {recipient}").format(recipient=recipient_full_name) }}, -Invitation message: -{{ message }} +{{ _("You have been invited to join community *{community_title}* as *{role}*").format(community_title=community_title, role=role) }} +{% if message %} -{%- endif %} +{{ _("with the following message:")}} +{{message}} -You can access the invitation request here: <{{ request_link }}> +{% endif %} +[{{ _("Check out the invitation") }}]({{ request_link }}) -Best regards, +{{ _("Best regards") }}, -- -CERN Document Server <{{ config.SITE_UI_URL }}> -Need help? <{{ help_url }}> +CERN Document Server {{ _("{site_url}").format(site_url=config.SITE_UI_URL) }} +{{ _("Need help? {help_url}".format(help_url=help_url)) }} -This is an auto-generated message. To manage notifications, visit your account settings <{{ account_settings_link }}>. +{{ _("This is an auto-generated message. To manage notifications, visit your account settings {account_settings_link}.".format(account_settings_link=account_settings_link))}} {%- endblock md_body %} diff --git a/templates/semantic-ui/invenio_notifications/community-submission.accept.jinja b/templates/semantic-ui/invenio_notifications/community-submission.accept.jinja index 1c3f32c..0047e39 100644 --- a/templates/semantic-ui/invenio_notifications/community-submission.accept.jinja +++ b/templates/semantic-ui/invenio_notifications/community-submission.accept.jinja @@ -1,67 +1,102 @@ -{% set _submission_request = notification.context.request %} -{% set _community = _submission_request.receiver %} -{% set _record = _submission_request.topic %} -{% set request_id = _submission_request.id %} +{% set submission_request = notification.context.request %} +{% set community = submission_request.receiver %} +{% set creator = submission_request.created_by %} +{% set record = submission_request.topic %} +{% set request_id = submission_request.id %} +{% set executing_user = notification.context.executing_user %} +{% set message = notification.context.message | safe if notification.context.message else '' %} +{% set community_title = community.metadata.title %} +{% set record_title = record.metadata.title %} +{% set curator_name = executing_user.username or executing_user.profile.full_name %} {% set recipient_full_name = recipient.data.profile.full_name %} {% set help_url = config.CDS_SERVICE_ELEMENT_URL %} -{% set community_title = _community.metadata.title %} -{% set record_title = _record.metadata.title %} {# 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 -%} -[CDS] βœ… Community inclusion accepted for "{{record_title}}" + [CDS] {{ _("βœ… Community inclusion accepted for '{record_title}'").format(record_title=record_title) }} {%- endblock subject -%} {%- block html_body -%} -

Dear {{ recipient_full_name }},

- -

The new record "{{ record_title }}" has been accepted to the community "{{ community_title }}".
-You can access the submission request here: {{ request_link }}

+ + + + + + + + {% if message %} + + + + {% endif %} + + + + + + + + + +
{{ _("Dear {recipient}").format(recipient=recipient_full_name) }}, +
{{ _("The community curator '@{curator_name}' accepted the record '{record_title}' into the community '{community_title}'").format(curator_name=curator_name, community_title=community_title, record_title=record_title) }} + {% if message %} + {{ _(" with the following message:")}} + {% endif %} +
{{message}}
{{ _("Check out the submission request")}}
+ {{ _("Best regards") }},
+ --
+ CERN Document Server {{ config.SITE_UI_URL }}
+ {{ _("Need help?") }} {{ help_url }} +
{{ _("This is an auto-generated message. To manage notifications, visit your")}} {{ _("account settings")}}.
+{%- endblock html_body %} -Best regards,
---
-CERN Document Server {{ config.SITE_UI_URL }}
-Need help? {{ help_url }}

+{%- block plain_body -%} +{{ _("Dear {recipient}").format(recipient=recipient_full_name) }}, ---
-

This is an auto-generated message. To manage notifications, visit your account settings.

-{%- endblock html_body -%} +{{ _("The community curator @{curator_name} accepted the record '{record_title}' into the community '{community_title}'").format(curator_name=curator_name, community_title=community_title, record_title=record_title) }} +{% if message %} -{%- block plain_body -%} -Dear {{ recipient_full_name }}, +{{ _("with the following message:")}} +{{message}} -The new record "{{ record_title }}" has been accepted to the community "{{ community_title }}". -You can access the submission request here: <{{ request_link }}> +{% endif %} +{{ _("Check out the submission request: {request_link}".format(request_link=request_link)) }} -Best regards, +{{ _("Best regards") }}, -- -CERN Document Server <{{ config.SITE_UI_URL }}> -Need help? <{{ help_url }}> +CERN Document Server {{ _("{site_url}").format(site_url=config.SITE_UI_URL) }} +{{ _("Need help? {help_url}".format(help_url=help_url)) }} -This is an auto-generated message. To manage notifications, visit your account settings <{{ account_settings_link }}>. -{%- endblock plain_body -%} +{{ _("This is an auto-generated message. To manage notifications, visit your account settings {account_settings_link}.".format(account_settings_link=account_settings_link))}} +{%- endblock plain_body %} {# Markdown for Slack/Mattermost/chat #} {%- block md_body -%} -Dear {{ recipient_full_name }}, +{{ _("Dear {recipient}").format(recipient=recipient_full_name) }}, + +{{ _("The community curator *@{curator_name}* accepted the record *{record_title}* into the community *{community_title}*").format(curator_name=curator_name, community_title=community_title, record_title=record_title) }} +{% if message %} + +{{ _("with the following message:")}} +{{message}} -The new record *{{ record_title }}* has been accepted to the community *{{ community_title }}*. -You can access the submission request here: <{{ request_link }}> +{% endif %} +[{{ _("Check out the submission request") }}]({{ request_link }}) -Best regards, +{{ _("Best regards") }}, -- -CERN Document Server <{{ config.SITE_UI_URL }}> -Need help? <{{ help_url }}> +CERN Document Server {{ _("{site_url}").format(site_url=config.SITE_UI_URL) }} +{{ _("Need help? {help_url}".format(help_url=help_url)) }} -This is an auto-generated message. To manage notifications, visit your account settings <{{ account_settings_link }}>. -{%- endblock md_body -%} +{{ _("This is an auto-generated message. To manage notifications, visit your account settings {account_settings_link}.".format(account_settings_link=account_settings_link))}} +{%- endblock md_body %} diff --git a/templates/semantic-ui/invenio_notifications/community-submission.cancel.jinja b/templates/semantic-ui/invenio_notifications/community-submission.cancel.jinja new file mode 100644 index 0000000..e0f5f77 --- /dev/null +++ b/templates/semantic-ui/invenio_notifications/community-submission.cancel.jinja @@ -0,0 +1,83 @@ +{% set submission_request = notification.context.request %} +{% set community = submission_request.receiver %} +{% set creator = submission_request.created_by %} +{% set record = submission_request.topic %} +{% set request_id = submission_request.id %} +{% set executing_user = notification.context.executing_user %} + +{% set community_title = community.metadata.title %} +{% set record_title = record.metadata.title %} +{% set cancel_name = executing_user.username or executing_user.profile.full_name %} +{% set recipient_full_name = recipient.data.profile.full_name %} +{% set help_url = config.CDS_SERVICE_ELEMENT_URL %} + +{# 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 -%} + [CDS] {{ _("❌ Community inclusion cancelled for '{record_title}'").format(record_title=record_title) }} +{%- endblock subject -%} + +{%- block html_body -%} + + + + + + + + + + + + + + + + +
{{ _("Dear {recipient}").format(recipient=recipient_full_name) }}, +
{{ _("The record submission for your community '{community_title}' was cancelled by '@{cancel_name}'.").format(cancel_name=cancel_name, community_title=community_title) }}
{{ _("Check out the submission request")}}
+ {{ _("Best regards") }},
+ --
+ CERN Document Server {{ config.SITE_UI_URL }}
+ {{ _("Need help?") }} {{ help_url }} +
{{ _("This is an auto-generated message. To manage notifications, visit your")}} {{ _("account settings")}}.
+{%- endblock html_body -%} + +{%- block plain_body -%} +{{ _("Dear {recipient}").format(recipient=recipient_full_name) }}, + +{{ _("The record submission for your community '{community_title}' was cancelled by '@{cancel_name}'.").format(cancel_name=cancel_name, community_title=community_title) }} + +{{ _("Check out the submission request: {request_link}".format(request_link=request_link)) }} + +{{ _("Best regards") }}, +-- +CERN Document Server {{ _("{site_url}").format(site_url=config.SITE_UI_URL) }} +{{ _("Need help? {help_url}".format(help_url=help_url)) }} + +{{ _("This is an auto-generated message. To manage notifications, visit your account settings {account_settings_link}.".format(account_settings_link=account_settings_link))}} +{%- endblock plain_body -%} + +{# Markdown for Slack/Mattermost/chat #} +{%- block md_body -%} +{{ _("Dear {recipient}").format(recipient=recipient_full_name) }}, + +{{ _("The record submission for your community *'{community_title}'* was cancelled by *'{cancel_name}'*.").format(cancel_name=cancel_name, community_title=community_title) }} + +[{{ _("Check out the submission request") }}]({{ request_link }}) + +{{ _("Best regards") }}, +-- +CERN Document Server {{ _("{site_url}").format(site_url=config.SITE_UI_URL) }} +{{ _("Need help? {help_url}".format(help_url=help_url)) }} + +{{ _("This is an auto-generated message. To manage notifications, visit your account settings {account_settings_link}.".format(account_settings_link=account_settings_link))}} +{%- endblock md_body -%} diff --git a/templates/semantic-ui/invenio_notifications/community-submission.decline.jinja b/templates/semantic-ui/invenio_notifications/community-submission.decline.jinja new file mode 100644 index 0000000..5d634f4 --- /dev/null +++ b/templates/semantic-ui/invenio_notifications/community-submission.decline.jinja @@ -0,0 +1,102 @@ +{% set submission_request = notification.context.request %} +{% set community = submission_request.receiver %} +{% set creator = submission_request.created_by %} +{% set record = submission_request.topic %} +{% set request_id = submission_request.id %} +{% set executing_user = notification.context.executing_user %} +{% set message = notification.context.message | safe if notification.context.message else '' %} +{% set community_title = community.metadata.title %} +{% set record_title = record.metadata.title %} +{% set curator_name = executing_user.username or executing_user.profile.full_name %} +{% set recipient_full_name = recipient.data.profile.full_name %} +{% set help_url = config.CDS_SERVICE_ELEMENT_URL %} + +{# 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 -%} + [CDS] {{ _("⛔️ Community inclusion declined for '{record_title}'").format(record_title=record_title) }} +{%- endblock subject -%} + +{%- block html_body -%} + + + + + + + + {% if message %} + + + + {% endif %} + + + + + + + + + +
{{ _("Dear {recipient}").format(recipient=recipient_full_name) }}, +
{{ _("The community curator '@{curator_name}' declined the record '{record_title}' into the community '{community_title}'").format(curator_name=curator_name, community_title=community_title, record_title=record_title) }} + {% if message %} + {{ _(" with the following message:")}} + {% endif %} +
{{message}}
{{ _("Check out the submission request")}}
+ {{ _("Best regards") }},
+ --
+ CERN Document Server {{ config.SITE_UI_URL }}
+ {{ _("Need help?") }} {{ help_url }} +
{{ _("This is an auto-generated message. To manage notifications, visit your")}} {{ _("account settings")}}.
+{%- endblock html_body -%} + +{%- block plain_body -%} +{{ _("Dear {recipient}").format(recipient=recipient_full_name) }}, + +{{ _("The community curator @{curator_name} declined the record '{record_title}' into the community '{community_title}'").format(curator_name=curator_name, community_title=community_title, record_title=record_title) }} +{% if message %} + +{{ _("with the following message:")}} +{{message}} + +{% endif %} +{{ _("Check out the submission request: {request_link}".format(request_link=request_link)) }} + +{{ _("Best regards") }}, +-- +CERN Document Server {{ _("{site_url}").format(site_url=config.SITE_UI_URL) }} +{{ _("Need help? {help_url}".format(help_url=help_url)) }} + +{{ _("This is an auto-generated message. To manage notifications, visit your account settings {account_settings_link}.".format(account_settings_link=account_settings_link))}} +{%- endblock plain_body -%} + +{# Markdown for Slack/Mattermost/chat #} +{%- block md_body -%} +{{ _("Dear {recipient}").format(recipient=recipient_full_name) }}, + +{{ _("The community curator *@{curator_name}* declined the record *{record_title}* into the community *{community_title}*").format(curator_name=curator_name, community_title=community_title, record_title=record_title) }} +{% if message %} + +{{ _("with the following message:")}} +{{message}} + +{% endif %} +[{{_("Check out the submission request")}}]({{request_link}}) + +{{ _("Best regards") }}, +-- +CERN Document Server {{ _("{site_url}").format(site_url=config.SITE_UI_URL) }} +{{ _("Need help? {help_url}".format(help_url=help_url)) }} + +{{ _("This is an auto-generated message. To manage notifications, visit your account settings {account_settings_link}.".format(account_settings_link=account_settings_link))}} +{%- endblock md_body -%} diff --git a/templates/semantic-ui/invenio_notifications/community-submission.expire.jinja b/templates/semantic-ui/invenio_notifications/community-submission.expire.jinja new file mode 100644 index 0000000..10d8289 --- /dev/null +++ b/templates/semantic-ui/invenio_notifications/community-submission.expire.jinja @@ -0,0 +1,81 @@ +{% set submission_request = notification.context.request %} +{% set community = submission_request.receiver %} +{% set creator = submission_request.created_by %} +{% set record = submission_request.topic %} +{% set request_id = submission_request.id %} + +{% set community_title = community.metadata.title %} +{% set record_title = record.metadata.title %} +{% set recipient_full_name = recipient.data.profile.full_name %} +{% set help_url = config.CDS_SERVICE_ELEMENT_URL %} + +{# 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 -%} + [CDS] {{ _("βŒ›οΈ Community inclusion expired for '{record_title}'").format(record_title=record_title) }} +{%- endblock subject -%} + +{%- block html_body -%} + + + + + + + + + + + + + + + + +
{{ _("Dear {recipient}").format(recipient=recipient_full_name) }}, +
{{ _("The submission for your record has expired.") }}
{{ _("Check out the submission request")}}
+ {{ _("Best regards") }},
+ --
+ CERN Document Server {{ config.SITE_UI_URL }}
+ {{ _("Need help?") }} {{ help_url }} +
{{ _("This is an auto-generated message. To manage notifications, visit your")}} {{ _("account settings")}}.
+{%- endblock html_body -%} + +{%- block plain_body -%} +{{ _("Dear {recipient}").format(recipient=recipient_full_name) }}, + +{{ _("The submission for your record has expired.") }} + +{{ _("Check out the submission request: {request_link}".format(request_link=request_link)) }} + +{{ _("Best regards") }}, +-- +CERN Document Server {{ _("{site_url}").format(site_url=config.SITE_UI_URL) }} +{{ _("Need help? {help_url}".format(help_url=help_url)) }} + +{{ _("This is an auto-generated message. To manage notifications, visit your account settings {account_settings_link}.".format(account_settings_link=account_settings_link))}} +{%- endblock plain_body -%} + +{# Markdown for Slack/Mattermost/chat #} +{%- block md_body -%} +{{ _("Dear {recipient}").format(recipient=recipient_full_name) }}, + +{{ _("The submission for your record has expired.") }} + +[{{_("Check out the submission request")}}]({{request_link}}) + +{{ _("Best regards") }}, +-- +CERN Document Server {{ _("{site_url}").format(site_url=config.SITE_UI_URL) }} +{{ _("Need help? {help_url}".format(help_url=help_url)) }} + +{{ _("This is an auto-generated message. To manage notifications, visit your account settings {account_settings_link}.".format(account_settings_link=account_settings_link))}} +{%- endblock md_body -%} diff --git a/templates/semantic-ui/invenio_notifications/community-submission.submit.jinja b/templates/semantic-ui/invenio_notifications/community-submission.submit.jinja index a2503d3..43e3439 100644 --- a/templates/semantic-ui/invenio_notifications/community-submission.submit.jinja +++ b/templates/semantic-ui/invenio_notifications/community-submission.submit.jinja @@ -1,67 +1,101 @@ -{% set _submission_request = notification.context.request %} -{% set _community = _submission_request.receiver %} -{% set _record = _submission_request.topic %} -{% set request_id = _submission_request.id %} +{% set submission_request = notification.context.request %} +{% set community = submission_request.receiver %} +{% set creator = submission_request.created_by %} +{% set record = submission_request.topic %} +{% set request_id = submission_request.id %} +{% set creator_name = creator.username or creator.profile.full_name %} +{% set community_title = community.metadata.title %} +{% set record_title = record.metadata.title %} +{% set message = notification.context.message | safe if notification.context.message else '' %} {% set recipient_full_name = recipient.data.profile.full_name %} {% set help_url = config.CDS_SERVICE_ELEMENT_URL %} -{% set community_title = _community.metadata.title %} -{% set record_title = _record.metadata.title %} {# 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 -%} -[CDS] New submission "{{ record_title }}" in "{{ community_title }}" community + [CDS] {{ _("πŸ“₯ New record submission to your community '{community_title}'").format(community_title=community_title) }} {%- endblock subject -%} {%- block html_body -%} -

Dear {{ recipient_full_name }},

- -

The new record "{{ record_title }}" has been submitted to the community "{{ community_title }}".
-You can access the review request here: {{ request_link }}

+ + + + + + + + {% if message %} + + + + {% endif %} + + + + + + + + + +
{{ _("Dear {recipient}").format(recipient=recipient_full_name) }}, +
{{ _("The record '{record_title}' was submitted to your community '{community_title}' by '@{creator_name}'").format(record_title=record_title, community_title=community_title, creator_name=creator_name) }} + {% if message %} + {{ _(" with the following message:")}} + {% endif %} +
{{message}}
{{ _("Review the submission request")}}
+ {{ _("Best regards") }},
+ --
+ CERN Document Server {{ config.SITE_UI_URL }}
+ {{ _("Need help?") }} {{ help_url }} +
{{ _("This is an auto-generated message. To manage notifications, visit your")}} {{ _("account settings")}}.
+{%- endblock html_body %} -Best regards,
---
-CERN Document Server {{ config.SITE_UI_URL }}
-Need help? {{ help_url }}

+{%- block plain_body -%} +{{ _("Dear {recipient}").format(recipient=recipient_full_name) }}, ---
-

This is an auto-generated message. To manage notifications, visit your account settings.

-{%- endblock html_body -%} +{{ _("The record '{record_title}' was submitted to your community '{community_title}' by @'{creator_name}'.").format(record_title=record_title, community_title=community_title, creator_name=creator_name) }} +{% if message %} -{%- block plain_body -%} -Dear {{ recipient_full_name }}, +{{ _("with the following message:")}} +{{message}} -The new record "{{ record_title }}" has been submitted to the community "{{ community_title }}". -You can access the review request here: <{{ request_link }}> +{% endif %} +{{ _("Review the submission request: ") }}{{ request_link }} -Best regards, +{{ _("Best regards") }}, -- -CERN Document Server <{{ config.SITE_UI_URL }}> -Need help? <{{ help_url }}> +CERN Document Server {{ _("{site_url}").format(site_url=config.SITE_UI_URL) }} +{{ _("Need help? {help_url}".format(help_url=help_url)) }} -This is an auto-generated message. To manage notifications, visit your account settings <{{ account_settings_link }}>. -{%- endblock plain_body -%} +{{ _("This is an auto-generated message. To manage notifications, visit your account settings {account_settings_link}.".format(account_settings_link=account_settings_link))}} +{%- endblock plain_body %} {# Markdown for Slack/Mattermost/chat #} {%- block md_body -%} -Dear {{ recipient_full_name }}, +{{ _("Dear {recipient}").format(recipient=recipient_full_name) }}, + +{{ _("The record *'{record_title}'* was submitted to your community *'{community_title}'* by *@'{creator_name}'*.").format(record_title=record_title, community_title=community_title, creator_name=creator_name) }} +{% if message %} + +{{ _("with the following message:")}} -The new record *{{ record_title }}* has been submitted to the community *{{ community_title }}*. -You can access the review request here: <{{ request_link }}> +{{message}} +{% endif %} +{{ _("Review the submission request: ") }}{{ request_link }} -Best regards, +{{ _("Best regards") }}, -- -CERN Document Server <{{ config.SITE_UI_URL }}> -Need help? <{{ help_url }}> +CERN Document Server {{ _("{site_url}").format(site_url=config.SITE_UI_URL) }} +{{ _("Need help? {help_url}".format(help_url=help_url)) }} -This is an auto-generated message. To manage notifications, visit your account settings <{{ account_settings_link }}>. +{{ _("This is an auto-generated message. To manage notifications, visit your account settings {account_settings_link}.".format(account_settings_link=account_settings_link))}} {%- endblock md_body -%} diff --git a/templates/semantic-ui/invenio_notifications/grant-user-access.create.jinja b/templates/semantic-ui/invenio_notifications/grant-user-access.create.jinja new file mode 100644 index 0000000..aec7846 --- /dev/null +++ b/templates/semantic-ui/invenio_notifications/grant-user-access.create.jinja @@ -0,0 +1,96 @@ +{% set record = notification.context.record %} +{% set receiver = notification.context.receiver %} +{% set message = notification.context.message | safe if notification.context.message else '' %} +{% set permission = notification.context.permission %} +{% set record_title = record.metadata.title %} +{% set record_link = record.links.self_html %} +{% set recipient_full_name = recipient.data.profile.full_name %} +{% set help_url = config.CDS_SERVICE_ELEMENT_URL %} + +{% set account_settings_link = "{ui}/account/settings/notifications".format( + ui=config.SITE_UI_URL + ) +%} + +{%- block subject -%} + [CDS] {{ _("πŸ‘€βœ”οΈ You were granted {permission} access to record '{record_title}'").format(permission=permission, record_title=record_title) }} +{%- endblock subject -%} + +{%- block html_body -%} + + + + + + + + + {% if message %} + + {% endif %} + + + + + + + + + + +
{{ _("Dear {recipient}").format(recipient=recipient_full_name) }}, +
{{ _("You have now permission to {permission} the record '{record_title}'.").format(record_title=record_title, permission=permission)}} + {% if message %} +
+
+ {{ _("Message:")}} + {% endif %} +
{{message}}
{{ _("View the record")}}
+ {{ _("Best regards") }},
+ --
+ CERN Document Server {{ config.SITE_UI_URL }}
+ {{ _("Need help?") }} {{ help_url }} +
{{ _("This is an auto-generated message. To manage notifications, visit your")}} {{ _("account settings")}}.
+{%- endblock html_body -%} + +{%- block plain_body -%} +{{ _("Dear {recipient}").format(recipient=recipient_full_name) }}, + +{{ _("You have now permission to {permission} the record '{record_title}'.").format(record_title=record_title, permission=permission)}} +{% if message %} +{{ _("Message:")}} +
+{{message}} +{% endif %} + +{{ _("View the record: {record_link}".format(record_link=record_link)) }} + +{{ _("Best regards") }}, +-- +CERN Document Server {{ _("{site_url}").format(site_url=config.SITE_UI_URL) }} +{{ _("Need help? {help_url}".format(help_url=help_url)) }} + +{{ _("This is an auto-generated message. To manage notifications, visit your account settings {account_settings_link}.".format(account_settings_link=account_settings_link))}} +{%- endblock plain_body -%} + +{# Markdown for Slack/Mattermost/chat #} +{%- block md_body -%} +{{ _("Dear {recipient}").format(recipient=recipient_full_name) }}, + +{{ _("You have now permission to *{permission}* the record *'{record_title}'*.").format(record_title=record_title, permission=permission)}} + +{% if message %} +
+{{ _("Message:")}} +{{message}} +{% endif %} + +[{{ _("View the record") }}]({{ record_link }}) + +{{ _("Best regards") }}, +-- +CERN Document Server {{ _("{site_url}").format(site_url=config.SITE_UI_URL) }} +{{ _("Need help? {help_url}".format(help_url=help_url)) }} + +{{ _("This is an auto-generated message. To manage notifications, visit your account settings {account_settings_link}.".format(account_settings_link=account_settings_link))}} +{%- endblock md_body -%} diff --git a/templates/semantic-ui/invenio_notifications/guest-access-request-token.create.jinja b/templates/semantic-ui/invenio_notifications/guest-access-request-token.create.jinja new file mode 100644 index 0000000..520a7c8 --- /dev/null +++ b/templates/semantic-ui/invenio_notifications/guest-access-request-token.create.jinja @@ -0,0 +1,76 @@ +{% set access_request = notification.context.request %} +{% set record = notification.context.record %} +{% set verify_url = notification.context.verify_url %} +{% set record_title = record.metadata.title %} +{% if recipient.data.profile %} + {% set recipient_full_name = recipient.data.profile.full_name | safe %} +{% else %} + {% set recipient_full_name = recipient.data.email | safe %} +{% endif %} +{% set help_url = config.CDS_SERVICE_ELEMENT_URL %} + +{% set account_settings_link = "{ui}/account/settings/notifications".format( + ui=config.SITE_UI_URL + ) +%} + +{%- block subject -%} + [CDS] {{ _("❗️Access request for '{record_title}' requires action").format(record_title=record_title) }} +{%- endblock subject -%} + +{%- block html_body -%} + + + + + + + + + + + + + + + + +
{{ _("Dear {recipient}").format(recipient=recipient_full_name) }}, +
{{ _("Please verify the email address in order to submit the access request for the record '{record_title}'").format(record_title=record_title) }}
{{ _("Verify e-mail address") }}
+ {{ _("Best regards") }},
+ --
+ CERN Document Server {{ config.SITE_UI_URL }}
+ {{ _("Need help?") }} {{ help_url }} +
{{ _("This is an auto-generated message. To manage notifications, visit your")}} {{ _("account settings")}}.
+{%- endblock html_body -%} + +{%- block plain_body -%} +{{ _("Dear {recipient}").format(recipient=recipient_full_name) }}, + +{{ _("Please verify your e-mail address via the following link in order to submit the access request for the record '{record_title}'.".format(record_title=record_title)) }} + +{{ _("Verify e-mail address: {url}".format(url=verify_url)) }} + +{{ _("Best regards") }}, +-- +CERN Document Server {{ _("{site_url}").format(site_url=config.SITE_UI_URL) }} +{{ _("Need help? {help_url}".format(help_url=help_url)) }} + +{{ _("This is an auto-generated message. To manage notifications, visit your account settings {account_settings_link}.".format(account_settings_link=account_settings_link))}} +{%- endblock plain_body -%} + +{# Markdown for Slack/Mattermost/chat #} +{%- block md_body -%} +{{ _("Dear {recipient}").format(recipient=recipient_full_name) }}, + +{{ _("Please verify your e-mail address via the following link in order to submit the access request for the record *'{record_title}'*.".format(record_title=record_title)) }} + +[{{ _("Verify e-mail address") }}]({{ verify_url }}) + +{{ _("Best regards") }}, +-- +CERN Document Server {{ _("{site_url}").format(site_url=config.SITE_UI_URL) }} +{{ _("Need help? {help_url}".format(help_url=help_url)) }} + +{{ _("This is an auto-generated message. To manage notifications, visit your account settings {account_settings_link}.".format(account_settings_link=account_settings_link))}} +{%- endblock md_body -%} diff --git a/templates/semantic-ui/invenio_notifications/guest-access-request.accept.jinja b/templates/semantic-ui/invenio_notifications/guest-access-request.accept.jinja new file mode 100644 index 0000000..960bec8 --- /dev/null +++ b/templates/semantic-ui/invenio_notifications/guest-access-request.accept.jinja @@ -0,0 +1,76 @@ +{% set access_request = notification.context.request %} +{% set record = access_request.topic %} +{% set access_url = notification.context.access_url %} +{% set record_title = record.metadata.title %} +{% if recipient.data.profile %} + {% set recipient_full_name = recipient.data.profile.full_name | safe %} +{% else %} + {% set recipient_full_name = recipient.data.email | safe %} +{% endif %} +{% set help_url = config.CDS_SERVICE_ELEMENT_URL %} + +{% set account_settings_link = "{ui}/account/settings/notifications".format( + ui=config.SITE_UI_URL + ) +%} + +{%- block subject -%} + [CDS] {{ _("βœ… Access request for '{record_title}' was accepted.").format(record_title=record_title) }} +{%- endblock subject -%} + +{%- block html_body -%} + + + + + + + + + + + + + + + + +
{{ _("Dear {recipient}").format(recipient=recipient_full_name) }}, +
{{ _("Your access request for '{record_title}' was accepted.").format(record_title=record_title) }}
{{ _("Access the record") }}
+ {{ _("Best regards") }},
+ --
+ CERN Document Server {{ config.SITE_UI_URL }}
+ {{ _("Need help?") }} {{ help_url }} +
{{ _("This is an auto-generated message. To manage notifications, visit your")}} {{ _("account settings")}}.
+{%- endblock html_body -%} + +{%- block plain_body -%} +{{ _("Dear {recipient}").format(recipient=recipient_full_name) }}, + +{{ _("Your access request for '{record_title}' was accepted.").format(record_title=record_title) }} + +{{ _("Access the record here: {url}".format(url=access_url)) }} + +{{ _("Best regards") }}, +-- +CERN Document Server {{ _("{site_url}").format(site_url=config.SITE_UI_URL) }} +{{ _("Need help? {help_url}".format(help_url=help_url)) }} + +{{ _("This is an auto-generated message. To manage notifications, visit your account settings {account_settings_link}.".format(account_settings_link=account_settings_link))}} +{%- endblock plain_body -%} + +{# Markdown for Slack/Mattermost/chat #} +{%- block md_body -%} +{{ _("Dear {recipient}").format(recipient=recipient_full_name) }}, + +{{ _("Your access request for *'{record_title}'* was accepted.").format(record_title=record_title) }} + +[{{ _("Access the record") }}]({{ access_url }}) + +{{ _("Best regards") }}, +-- +CERN Document Server {{ _("{site_url}").format(site_url=config.SITE_UI_URL) }} +{{ _("Need help? {help_url}".format(help_url=help_url)) }} + +{{ _("This is an auto-generated message. To manage notifications, visit your account settings {account_settings_link}.".format(account_settings_link=account_settings_link))}} +{%- endblock md_body -%} diff --git a/templates/semantic-ui/invenio_notifications/guest-access-request.cancel.jinja b/templates/semantic-ui/invenio_notifications/guest-access-request.cancel.jinja new file mode 100644 index 0000000..434adaf --- /dev/null +++ b/templates/semantic-ui/invenio_notifications/guest-access-request.cancel.jinja @@ -0,0 +1,102 @@ +{% set submission_request = notification.context.request %} +{% set record = submission_request.topic %} +{% set request_id = submission_request.id %} +{% set message = notification.context.message | safe if notification.context.message else '' %} + +{% set record_link = record.links.self_html %} +{% if recipient.data.profile %} + {% set recipient_full_name = recipient.data.profile.full_name | safe %} +{% else %} + {% set recipient_full_name = recipient.data.email | safe %} +{% endif %} +{% set help_url = config.CDS_SERVICE_ELEMENT_URL %} + +{# 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 -%} + [CDS] {{ _("❌ Access request canceled") }} +{%- endblock subject -%} + +{%- block html_body -%} + + + + + + + + {% if message %} + + + + {% endif %} + + + + + + + + + +
{{ _("Dear {recipient}").format(recipient=recipient_full_name) }}, +
{{ _("Your access request has been canceled") }} + {% if message %} + {{ _(" with the following message:") }} + {% endif %} +
{{ message }}
{{ _("View the record") }}
+ {{ _("Best regards") }},
+ --
+ CERN Document Server {{ config.SITE_UI_URL }}
+ {{ _("Need help?") }} {{ help_url }} +
{{ _("This is an auto-generated message. To manage notifications, visit your") }} {{ _("account settings") }}.
+{%- endblock html_body -%} + +{%- block plain_body -%} +{{ _("Dear {recipient}").format(recipient=recipient_full_name) }}, + +{{ _("Your access request has been canceled") }} +{% if message %} + +{{ _("with the following message:") }} +{{ message }} + +{% endif %} +{{ _("View the record: ") }}{{ record_link }} + +{{ _("Best regards") }}, +-- +CERN Document Server {{ _("{site_url}").format(site_url=config.SITE_UI_URL) }} +{{ _("Need help? {help_url}".format(help_url=help_url)) }} + +{{ _("This is an auto-generated message. To manage notifications, visit your account settings {account_settings_link}.".format(account_settings_link=account_settings_link)) }} +{%- endblock plain_body -%} + +{# Markdown for Slack/Mattermost/chat #} +{%- block md_body -%} +{{ _("Dear {recipient}").format(recipient=recipient_full_name) }}, + +{{ _("Your access request has been canceled") }} +{% if message %} + +{{ _("with the following message:") }} +{{ message }} + +{% endif %} +[{{ _("View the record") }}]({{ record_link }}) + +{{ _("Best regards") }}, +-- +CERN Document Server {{ _("{site_url}").format(site_url=config.SITE_UI_URL) }} +{{ _("Need help? {help_url}".format(help_url=help_url)) }} + +{{ _("This is an auto-generated message. To manage notifications, visit your account settings {account_settings_link}.".format(account_settings_link=account_settings_link)) }} +{%- endblock md_body -%} diff --git a/templates/semantic-ui/invenio_notifications/guest-access-request.decline.jinja b/templates/semantic-ui/invenio_notifications/guest-access-request.decline.jinja new file mode 100644 index 0000000..8b5a418 --- /dev/null +++ b/templates/semantic-ui/invenio_notifications/guest-access-request.decline.jinja @@ -0,0 +1,103 @@ +{% set submission_request = notification.context.request %} +{% set record = submission_request.topic %} +{% set request_id = submission_request.id %} +{% set message = notification.context.message | safe if notification.context.message else '' %} + +{% set record_title = record.metadata.title %} +{% set record_link = record.links.self_html %} +{% if recipient.data.profile %} + {% set recipient_full_name = recipient.data.profile.full_name | safe %} +{% else %} + {% set recipient_full_name = recipient.data.email | safe %} +{% endif %} +{% set help_url = config.CDS_SERVICE_ELEMENT_URL %} + +{# 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 -%} + [CDS] {{ _("⛔️ Access request declined") }} +{%- endblock subject -%} + +{%- block html_body -%} + + + + + + + + {% if message %} + + + + {% endif %} + + + + + + + + + +
{{ _("Dear {recipient}").format(recipient=recipient_full_name) }}, +
{{ _("The owner of '{record_title}' has declined your access request").format(record_title=record_title) }} + {% if message %} + {{ _(" with the following message:") }} + {% endif %} +
{{ message }}
{{ _("View the record") }}
+ {{ _("Best regards") }},
+ --
+ CERN Document Server {{ config.SITE_UI_URL }}
+ {{ _("Need help?") }} {{ help_url }} +
{{ _("This is an auto-generated message. To manage notifications, visit your") }} {{ _("account settings") }}.
+{%- endblock html_body -%} + +{%- block plain_body -%} +{{ _("Dear {recipient}").format(recipient=recipient_full_name) }}, + +{{ _("The owner of '{record_title}' has declined your access request").format(record_title=record_title) }} +{% if message %} + +{{ _("with the following message:") }} +{{ message }} + +{% endif %} +{{ _("View the record: ") }}{{ record_link }} + +{{ _("Best regards") }}, +-- +CERN Document Server {{ _("{site_url}").format(site_url=config.SITE_UI_URL) }} +{{ _("Need help? {help_url}".format(help_url=help_url)) }} + +{{ _("This is an auto-generated message. To manage notifications, visit your account settings {account_settings_link}.".format(account_settings_link=account_settings_link)) }} +{%- endblock plain_body -%} + +{# Markdown for Slack/Mattermost/chat #} +{%- block md_body -%} +{{ _("Dear {recipient}").format(recipient=recipient_full_name) }}, + +{{ _("The owner of *{record_title}* has declined your access request").format(record_title=record_title) }} +{% if message %} + +{{ _("with the following message:") }} +{{ message }} + +{% endif %} +[{{ _("View the record") }}]({{ record_link }}) + +{{ _("Best regards") }}, +-- +CERN Document Server {{ _("{site_url}").format(site_url=config.SITE_UI_URL) }} +{{ _("Need help? {help_url}".format(help_url=help_url)) }} + +{{ _("This is an auto-generated message. To manage notifications, visit your account settings {account_settings_link}.".format(account_settings_link=account_settings_link)) }} +{%- endblock md_body -%} diff --git a/templates/semantic-ui/invenio_notifications/guest-access-request.submit.jinja b/templates/semantic-ui/invenio_notifications/guest-access-request.submit.jinja new file mode 100644 index 0000000..9be811b --- /dev/null +++ b/templates/semantic-ui/invenio_notifications/guest-access-request.submit.jinja @@ -0,0 +1,86 @@ +{% set access_request = notification.context.request %} +{% set creator_email = access_request.created_by %} +{% set record = access_request.topic %} + +{% set record_title = record.metadata.title %} +{% set request_id = access_request.id %} +{% set recipient_full_name = recipient.data.profile.full_name %} +{% set help_url = config.CDS_SERVICE_ELEMENT_URL %} + +{# 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 -%} + [CDS] {{ _("πŸ“₯ New access request for your record '{record_title}'").format(record_title=record_title) }} +{%- endblock subject -%} + +{%- block html_body -%} + + + + + + + + + + + + + + + + + + + +
{{ _("Dear {recipient}").format(recipient=recipient_full_name) }}, +
{{ _("An access request was submitted for your record '{record_title}'.").format(record_title=record_title) }}
{{ _("The requestor's e-mail address: {email}").format(email=creator_email) }}
{{ _("See request details")}}
+ {{ _("Best regards") }},
+ --
+ CERN Document Server {{ config.SITE_UI_URL }}
+ {{ _("Need help?") }} {{ help_url }} +
{{ _("This is an auto-generated message. To manage notifications, visit your")}} {{ _("account settings")}}.
+{%- endblock html_body -%} + +{%- block plain_body -%} +{{ _("Dear {recipient}").format(recipient=recipient_full_name) }}, + +{{ _("An access request was submitted for your record '{record_title}'.").format(record_title=record_title) }} + +{{ _("The requestor's e-mail address: {email}".format(email=creator_email)) }} + +{{ _("See request details: {request_link}".format(request_link=request_link)) }} + +{{ _("Best regards") }}, +-- +CERN Document Server {{ _("{site_url}").format(site_url=config.SITE_UI_URL) }} +{{ _("Need help? {help_url}".format(help_url=help_url)) }} + +{{ _("This is an auto-generated message. To manage notifications, visit your account settings {account_settings_link}.".format(account_settings_link=account_settings_link))}} +{%- endblock plain_body -%} + +{# Markdown for Slack/Mattermost/chat #} +{%- block md_body -%} +{{ _("Dear {recipient}").format(recipient=recipient_full_name) }}, + +{{ _("An access request was submitted for your record '{record_title}'.").format(record_title=record_title) }} + +{{ _("The requestor's e-mail address: {email}".format(email=creator_email)) }} + +[{{ _("See request details") }}]({{ request_link }}) + +{{ _("Best regards") }}, +-- +CERN Document Server {{ _("{site_url}").format(site_url=config.SITE_UI_URL) }} +{{ _("Need help? {help_url}".format(help_url=help_url)) }} + +{{ _("This is an auto-generated message. To manage notifications, visit your account settings {account_settings_link}.".format(account_settings_link=account_settings_link))}} +{%- endblock md_body -%} diff --git a/templates/semantic-ui/invenio_notifications/guest-access-request.submitted.jinja b/templates/semantic-ui/invenio_notifications/guest-access-request.submitted.jinja new file mode 100644 index 0000000..7b26035 --- /dev/null +++ b/templates/semantic-ui/invenio_notifications/guest-access-request.submitted.jinja @@ -0,0 +1,77 @@ +{% set access_request = notification.context.request %} +{% set request_id = access_request.id %} +{% set help_url = config.CDS_SERVICE_ELEMENT_URL %} +{% set account_settings_link = "{ui}/account/settings/notifications".format( + ui=config.SITE_UI_URL + ) +%} +{% set request_link = "{ui}/me/requests/{id}".format( + ui=config.SITE_UI_URL, id=request_id + ) +%} +{% if recipient.data.profile %} + {% set recipient_full_name = recipient.data.profile.full_name | safe %} +{% else %} + {% set recipient_full_name = recipient.data.email | safe %} +{% endif %} + +{%- block subject -%} + [CDS] {{ _("πŸ“₯ Your access request was submitted successfully") }} +{%- endblock subject -%} + +{%- block html_body -%} + + + + + + + + + + + + + + + + +
{{ _("Dear {recipient}").format(recipient=recipient_full_name) }}, +
{{ _("Your access request was submitted successfully.") }}
{{ _("View request details")}}
+ {{ _("Best regards") }},
+ --
+ CERN Document Server {{ config.SITE_UI_URL }}
+ {{ _("Need help?") }} {{ help_url }} +
{{ _("This is an auto-generated message. To manage notifications, visit your")}} {{ _("account settings")}}.
+{%- endblock html_body -%} + +{%- block plain_body -%} +{{ _("Dear {recipient}").format(recipient=recipient_full_name) }}, + +{{ _("Your access request was submitted successfully. The request details are available at:") }} + +{{ _("View request details: {request_link}".format(request_link=request_link))}} + +{{ _("Best regards") }}, +-- +CERN Document Server {{ _("{site_url}").format(site_url=config.SITE_UI_URL) }} +{{ _("Need help? {help_url}".format(help_url=help_url)) }} + +{{ _("This is an auto-generated message. To manage notifications, visit your account settings {account_settings_link}.".format(account_settings_link=account_settings_link))}} +{%- endblock plain_body -%} + +{# Markdown for Slack/Mattermost/chat #} +{%- block md_body -%} +{{ _("Dear {recipient}").format(recipient=recipient_full_name) }}, + +{{ _("Your access request was submitted successfully. The request details are available at:") }} + +[{{ _("View request details") }}]({{ request_link }}) + +{{ _("Best regards") }}, +-- +CERN Document Server {{ _("{site_url}").format(site_url=config.SITE_UI_URL) }} +{{ _("Need help? {help_url}".format(help_url=help_url)) }} + +{{ _("This is an auto-generated message. To manage notifications, visit your account settings {account_settings_link}.".format(account_settings_link=account_settings_link))}} +{%- endblock md_body -%} diff --git a/templates/semantic-ui/invenio_notifications/user-access-request.accept.jinja b/templates/semantic-ui/invenio_notifications/user-access-request.accept.jinja new file mode 100644 index 0000000..e1cc28f --- /dev/null +++ b/templates/semantic-ui/invenio_notifications/user-access-request.accept.jinja @@ -0,0 +1,94 @@ +{% set access_request = notification.context.request %} +{% set creator = access_request.created_by %} +{% set record = access_request.topic %} +{% set message = notification.context.message | safe if notification.context.message else '' %} + +{% set record_title = record.metadata.title %} +{% set record_link = record.links.self_html %} +{% set recipient_full_name = recipient.data.profile.full_name %} +{% set help_url = config.CDS_SERVICE_ELEMENT_URL %} + +{% set account_settings_link = "{ui}/account/settings/notifications".format( + ui=config.SITE_UI_URL + ) +%} + +{%- block subject -%} + [CDS] {{ _("βœ… Access request accepted") }} +{%- endblock subject -%} + +{%- block html_body -%} + + + + + + + + {% if message %} + + + + {% endif %} + + + + + + + + + +
{{ _("Dear {recipient}").format(recipient=recipient_full_name) }}, +
{{ _("The owner of '{record_title}' has accepted your access request").format(record_title=record_title)}} + {% if message %} + {{ _(" with the following message:")}} + {% endif %} +
{{message}}
{{ _("View the record")}}
+ {{ _("Best regards") }},
+ --
+ CERN Document Server {{ config.SITE_UI_URL }}
+ {{ _("Need help?") }} {{ help_url }} +
{{ _("This is an auto-generated message. To manage notifications, visit your")}} {{ _("account settings")}}.
+{%- endblock html_body -%} + +{%- block plain_body -%} +{{ _("Dear {recipient}").format(recipient=recipient_full_name) }}, + +{{ _("The owner of '{record_title}' has accepted your access request").format(record_title=record_title)}} +{% if message %} + +{{ _("with the following message:")}} +{{message}} + +{% endif %} +{{ _("View the record: ") }}{{ record_link }} + +{{ _("Best regards") }}, +-- +CERN Document Server {{ _("{site_url}").format(site_url=config.SITE_UI_URL) }} +{{ _("Need help? {help_url}".format(help_url=help_url)) }} + +{{ _("This is an auto-generated message. To manage notifications, visit your account settings {account_settings_link}.".format(account_settings_link=account_settings_link))}} +{%- endblock plain_body -%} + +{# Markdown for Slack/Mattermost/chat #} +{%- block md_body -%} +{{ _("Dear {recipient}").format(recipient=recipient_full_name) }}, + +{{ _("The owner of *{record_title}* has accepted your access request").format(record_title=record_title)}} +{% if message %} + +{{ _("with the following message:")}} +{{message}} + +{% endif %} +[{{ _("View the record") }}]({{ record_link }}) + +{{ _("Best regards") }}, +-- +CERN Document Server {{ _("{site_url}").format(site_url=config.SITE_UI_URL) }} +{{ _("Need help? {help_url}".format(help_url=help_url)) }} + +{{ _("This is an auto-generated message. To manage notifications, visit your account settings {account_settings_link}.".format(account_settings_link=account_settings_link))}} +{%- endblock md_body -%} diff --git a/templates/semantic-ui/invenio_notifications/user-access-request.cancel.jinja b/templates/semantic-ui/invenio_notifications/user-access-request.cancel.jinja new file mode 100644 index 0000000..9cf7415 --- /dev/null +++ b/templates/semantic-ui/invenio_notifications/user-access-request.cancel.jinja @@ -0,0 +1,101 @@ +{% set submission_request = notification.context.request %} +{% set community = submission_request.receiver %} +{% set creator = submission_request.created_by %} +{% set record = submission_request.topic %} +{% set request_id = submission_request.id %} +{% set executing_user = notification.context.executing_user %} +{% set message = notification.context.message | safe if notification.context.message else '' %} + +{% set cancel_name = executing_user.username or executing_user.profile.full_name %} +{% set recipient_full_name = recipient.data.profile.full_name %} +{% set help_url = config.CDS_SERVICE_ELEMENT_URL %} + +{# 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 -%} + [CDS] {{ _("❌ Access request canceled") }} +{%- endblock subject -%} + +{%- block html_body -%} + + + + + + + + {% if message %} + + + + {% endif %} + + + + + + + + + +
{{ _("Dear {recipient}").format(recipient=recipient_full_name) }}, +
{{ _("Your access request has been canceled by {cancel_name}").format(cancel_name=cancel_name) }} + {% if message %} + {{ _(" with the following message:") }} + {% endif %} +
{{ message }}
{{ _("View the record") }}
+ {{ _("Best regards") }},
+ --
+ CERN Document Server {{ config.SITE_UI_URL }}
+ {{ _("Need help?") }} {{ help_url }} +
{{ _("This is an auto-generated message. To manage notifications, visit your") }} {{ _("account settings") }}.
+{%- endblock html_body -%} + +{%- block plain_body -%} +{{ _("Dear {recipient}").format(recipient=recipient_full_name) }}, + +{{ _("Your access request has been canceled by {cancel_name}").format(cancel_name=cancel_name) }} +{% if message %} + +{{ _("with the following message:") }} +{{ message }} + +{% endif %} +{{ _("View the record") }}{{ request_link }} + +{{ _("Best regards") }}, +-- +CERN Document Server {{ _("{site_url}").format(site_url=config.SITE_UI_URL) }} +{{ _("Need help? {help_url}".format(help_url=help_url)) }} + +{{ _("This is an auto-generated message. To manage notifications, visit your account settings {account_settings_link}.".format(account_settings_link=account_settings_link)) }} +{%- endblock plain_body -%} + +{# Markdown for Slack/Mattermost/chat #} +{%- block md_body -%} +{{ _("Dear {recipient}").format(recipient=recipient_full_name) }}, + +{{ _("Your access request has been canceled by {cancel_name}").format(cancel_name=cancel_name) }} +{% if message %} + +{{ _("with the following message:") }} +{{ message }} + +{% endif %} +[{{ _("View the record") }}]({{ request_link }}) + +{{ _("Best regards") }}, +-- +CERN Document Server {{ _("{site_url}").format(site_url=config.SITE_UI_URL) }} +{{ _("Need help? {help_url}".format(help_url=help_url)) }} + +{{ _("This is an auto-generated message. To manage notifications, visit your account settings {account_settings_link}.".format(account_settings_link=account_settings_link)) }} +{%- endblock md_body -%} diff --git a/templates/semantic-ui/invenio_notifications/user-access-request.decline.jinja b/templates/semantic-ui/invenio_notifications/user-access-request.decline.jinja new file mode 100644 index 0000000..b4e49d6 --- /dev/null +++ b/templates/semantic-ui/invenio_notifications/user-access-request.decline.jinja @@ -0,0 +1,99 @@ +{% set submission_request = notification.context.request %} +{% set record = submission_request.topic %} +{% set request_id = submission_request.id %} +{% set message = notification.context.message | safe if notification.context.message else '' %} + +{% set record_title = record.metadata.title %} +{% set recipient_full_name = recipient.data.profile.full_name %} +{% set help_url = config.CDS_SERVICE_ELEMENT_URL %} +{% set record_link = record.links.self_html %} + +{# 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 -%} + [CDS] {{ _("⛔️ Access request declined") }} +{%- endblock subject -%} + +{%- block html_body -%} + + + + + + + + {% if message %} + + + + {% endif %} + + + + + + + + + +
{{ _("Dear {recipient}").format(recipient=recipient_full_name) }}, +
{{ _("The owner of '{record_title}' has declined your access request").format(record_title=record_title)}} + {% if message %} + {{ _(" with the following message:")}} + {% endif %} +
{{message}}
{{ _("View the record")}}
+ {{ _("Best regards") }},
+ --
+ CERN Document Server {{ config.SITE_UI_URL }}
+ {{ _("Need help?") }} {{ help_url }} +
{{ _("This is an auto-generated message. To manage notifications, visit your")}} {{ _("account settings")}}.
+{%- endblock html_body -%} + +{%- block plain_body -%} +{{ _("Dear {recipient}").format(recipient=recipient_full_name) }}, + +{{ _("The owner of '{record_title}' has declined your access request").format(record_title=record_title)}} +{% if message %} + +{{ _("with the following message:")}} +{{message}} + +{% endif %} +{{ _("View the record") }}{{ record_link }} + +{{ _("Best regards") }}, +-- +CERN Document Server {{ _("{site_url}").format(site_url=config.SITE_UI_URL) }} +{{ _("Need help? {help_url}".format(help_url=help_url)) }} + +{{ _("This is an auto-generated message. To manage notifications, visit your account settings {account_settings_link}.".format(account_settings_link=account_settings_link))}} +{%- endblock plain_body -%} + +{# Markdown for Slack/Mattermost/chat #} +{%- block md_body -%} +{{ _("Dear {recipient}").format(recipient=recipient_full_name) }}, + +{{ _("The owner of *{record_title}* has declined your access request").format(record_title=record_title)}} +{% if message %} + +{{ _("with the following message:")}} +{{message}} + +{% endif %} +[{{ _("View the record") }}]({{ record_link }}) + +{{ _("Best regards") }}, +-- +CERN Document Server {{ _("{site_url}").format(site_url=config.SITE_UI_URL) }} +{{ _("Need help? {help_url}".format(help_url=help_url)) }} + +{{ _("This is an auto-generated message. To manage notifications, visit your account settings {account_settings_link}.".format(account_settings_link=account_settings_link))}} +{%- endblock md_body -%} diff --git a/templates/semantic-ui/invenio_notifications/user-access-request.submit.jinja b/templates/semantic-ui/invenio_notifications/user-access-request.submit.jinja new file mode 100644 index 0000000..4f431b1 --- /dev/null +++ b/templates/semantic-ui/invenio_notifications/user-access-request.submit.jinja @@ -0,0 +1,84 @@ +{% set access_request = notification.context.request %} +{% set creator = access_request.created_by %} +{% set record = access_request.topic %} +{% set record_title = record.metadata.title %} +{% set request_id = access_request.id %} +{% set recipient_full_name = recipient.data.profile.full_name %} +{% set help_url = config.CDS_SERVICE_ELEMENT_URL %} + +{% 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 -%} + [CDS] {{ _("πŸ“₯ New access request for your record '{record_title}'").format(record_title=record_title) }} +{%- endblock subject -%} + +{%- block html_body -%} + + + + + + + + + + + + + + + + + + + +
{{ _("Dear {recipient}").format(recipient=recipient_full_name) }}, +
{{ _("An access request was submitted for your record '{record_title}'.").format(record_title=record_title) }}
{{ _("The requestor's e-mail address: {email}").format(email=creator.email) }}
{{ _("See request details")}}
+ {{ _("Best regards") }},
+ --
+ CERN Document Server {{ config.SITE_UI_URL }}
+ {{ _("Need help?") }} {{ help_url }} +
{{ _("This is an auto-generated message. To manage notifications, visit your")}} {{ _("account settings")}}.
+{%- endblock html_body -%} + +{%- block plain_body -%} +{{ _("Dear {recipient}").format(recipient=recipient_full_name) }}, + +{{ _("An access request was submitted for your record '{record_title}'.").format(record_title=record_title) }} + +{{ _("The requestor's e-mail address: {email}".format(email=creator.email)) }} + +{{ _("See request details: {request_link}".format(request_link=request_link)) }} + +{{ _("Best regards") }}, +-- +CERN Document Server {{ _("{site_url}").format(site_url=config.SITE_UI_URL) }} +{{ _("Need help? {help_url}".format(help_url=help_url)) }} + +{{ _("This is an auto-generated message. To manage notifications, visit your account settings {account_settings_link}.".format(account_settings_link=account_settings_link))}} +{%- endblock plain_body -%} + +{# Markdown for Slack/Mattermost/chat #} +{%- block md_body -%} +{{ _("Dear {recipient}").format(recipient=recipient_full_name) }}, + +{{ _("An access request was submitted for your record '{record_title}'.").format(record_title=record_title) }} + +{{ _("The requestor's e-mail address: {email}".format(email=creator.email)) }} + +[{{ _("See request details") }}]({{ request_link }}) + +{{ _("Best regards") }}, +-- +CERN Document Server {{ _("{site_url}").format(site_url=config.SITE_UI_URL) }} +{{ _("Need help? {help_url}".format(help_url=help_url)) }} + +{{ _("This is an auto-generated message. To manage notifications, visit your account settings {account_settings_link}.".format(account_settings_link=account_settings_link))}} +{%- endblock md_body -%}