From a909cfdb750a4cf93e2268dbc2815cc98b23e3ea Mon Sep 17 00:00:00 2001 From: hblankenship Date: Wed, 6 Nov 2024 10:19:38 -0600 Subject: [PATCH 1/2] add engagement closed template --- .../msteams/engagement_closed.tpl | 44 +++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 dojo/templates/notifications/msteams/engagement_closed.tpl diff --git a/dojo/templates/notifications/msteams/engagement_closed.tpl b/dojo/templates/notifications/msteams/engagement_closed.tpl new file mode 100644 index 00000000000..3e6bfeed0df --- /dev/null +++ b/dojo/templates/notifications/msteams/engagement_closed.tpl @@ -0,0 +1,44 @@ +{% load i18n %} +{% load display_tags %} +{ + "@context": "https://schema.org/extensions", + "@type": "MessageCard", + "title": "{% trans "Engagement closed" %}", + "summary": "{% trans "Engagement closed" %}", + "sections": [ + { + "activityTitle": "DefectDojo", + "activityImage": "https://raw.githubusercontent.com/DefectDojo/django-DefectDojo/master/dojo/static/dojo/img/chop.png", + "text": "{% trans "An engagement has been closed" %}.", + "facts": [ + { + "name": "{% trans "Product" %}:", + "value": "{{ engagement.product.name }}" + }, + { + "name": "{% trans "Engagement" %}:", + "value": "{{ engagement.name }}" + } + ] + } + {% if system_settings.disclaimer and system_settings.disclaimer.strip %} + ,{ + "activityTitle": "{% trans "Disclaimer" %}", + "text": "{{ system_settings.disclaimer }}" + } + {% endif %} + + ], + "potentialAction": [ + { + "@type": "OpenUri", + "name": "{% trans "View Engagement" %}", + "targets": [ + { + "os": "default", + "uri": "{{ url|full_url }}" + } + ] + } + ] +} \ No newline at end of file From c5909cc1460c1dbd89667b7324391f2163017d64 Mon Sep 17 00:00:00 2001 From: hblankenship Date: Wed, 6 Nov 2024 20:00:13 -0600 Subject: [PATCH 2/2] add templates for mail, slack, and alerts --- .../notifications/alert/engagement_closed.tpl | 3 ++ .../notifications/mail/engagement_closed.tpl | 41 +++++++++++++++++++ .../notifications/slack/engagement_closed.tpl | 10 +++++ 3 files changed, 54 insertions(+) create mode 100644 dojo/templates/notifications/alert/engagement_closed.tpl create mode 100644 dojo/templates/notifications/mail/engagement_closed.tpl create mode 100644 dojo/templates/notifications/slack/engagement_closed.tpl diff --git a/dojo/templates/notifications/alert/engagement_closed.tpl b/dojo/templates/notifications/alert/engagement_closed.tpl new file mode 100644 index 00000000000..2468c566e30 --- /dev/null +++ b/dojo/templates/notifications/alert/engagement_closed.tpl @@ -0,0 +1,3 @@ +{% load i18n %}{% blocktranslate trimmed with eng_name=engagement.name eng_product=engagement.product %} +The engagement "{{ eng_name }}" has been closed in the product "{{ eng_product }}". +{% endblocktranslate %} \ No newline at end of file diff --git a/dojo/templates/notifications/mail/engagement_closed.tpl b/dojo/templates/notifications/mail/engagement_closed.tpl new file mode 100644 index 00000000000..68eef654865 --- /dev/null +++ b/dojo/templates/notifications/mail/engagement_closed.tpl @@ -0,0 +1,41 @@ +{% load i18n %} +{% load navigation_tags %} +{% load display_tags %} +{% url 'view_product' engagement.product.id as product_url %} +{% url 'view_engagement' engagement.id as engagement_url %} + + + {% autoescape on %} +

+ {% trans "Hello" %}, +

+

+ {% blocktranslate trimmed with engagement_name=engagement.name engagement_product=engagement.product prod_url=product_url|full_url eng_url=engagement_url|full_url%} + The engagement "{{ engagement_name }}" has been closed in the product "{{ engagement_product }}". It can be viewed here: {{product}} / {{ engagement_name }} + {% endblocktranslate %} +

+
+
+ {% trans "Kind regards" %},
+
+ {% if system_settings.team_name %} + {{ system_settings.team_name }} + {% else %} + Defect Dojo + {% endif %} +
+
+

+ {% url 'notifications' as notification_url %} + {% trans "You can manage your notification settings here" %}: {{ notification_url|full_url }} +

+ {% if system_settings.disclaimer and system_settings.disclaimer.strip %} +
+
+ {% trans "Disclaimer" %}
+

{{ system_settings.disclaimer }}

+
+ {% endif %} + {% endautoescape %} + + diff --git a/dojo/templates/notifications/slack/engagement_closed.tpl b/dojo/templates/notifications/slack/engagement_closed.tpl new file mode 100644 index 00000000000..313c7a1c937 --- /dev/null +++ b/dojo/templates/notifications/slack/engagement_closed.tpl @@ -0,0 +1,10 @@ +{% load i18n %} +{% load display_tags %} +{% blocktranslate trimmed with name=engagement.name eng_product=engagement.product eng_url=url|full_url %} +The engagement "{{ name }}" has been closed in the product "{{ eng_product }}". It can be viewed here: {{ eng_url }} +{% endblocktranslate %} +{% if system_settings.disclaimer and system_settings.disclaimer.strip %} + + {% trans "Disclaimer" %}: + {{ system_settings.disclaimer }} +{% endif %}