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

Notifications subjects - add additional information (e.g. Project/Component/Severity) into Subject string #1823

Open
JN-CSIRT opened this issue Jul 25, 2022 · 7 comments · Fixed by #3422 or DependencyTrack/frontend#720
Labels
enhancement New feature or request good first issue Good for newcomers needs milestone Issues or PRs that are pending a milestone assignment p3 Nice-to-have features

Comments

@JN-CSIRT
Copy link

Current Behavior:

The notification email's subject are hard coded right now.

Proposed Behavior:

add the notification subject configuration to the notification template and use same params as there exists for content.

@JN-CSIRT JN-CSIRT added the enhancement New feature or request label Jul 25, 2022
@JN-CSIRT
Copy link
Author

JN-CSIRT commented Dec 5, 2022

Current Behavior:

The notification email's subject are hard coded now and contain the project name (twice) only.
E.g.: "New Vulnerability Identified on Project: [[PROJECTID]: [PROJECTID] : [VERSION]]"

Proposed Behavior:
add the notification subject configuration to the notification template in order to add all necessary information
E.g.:
{{ notification.title }}

{% if notification.group == "NEW_VULNERABILITY" %}
Email Subject: {{alert.name}}: {{ subject.component.project.name }}: {{ subject.component.project.version }}: {{ subject.component.toString }} {{ subject.component.version.toString }} {{ subject.vulnerability.severity }}
Vulnerability ID: {{ subject.vulnerability.vulnId }}
Vulnerability URL: {{ baseUrl }}/vulnerability/?source={{ subject.vulnerability.source }}&vulnId={{ subject.vulnerability.vulnId }}
Severity: {{ subject.vulnerability.severity }}
Source: {{ subject.vulnerability.source }}
Component: {{ subject.component.toString }}
Component URL: {{ baseUrl }}/component/?uuid={{ subject.component.uuid }}
Project: {{ subject.component.project.name }}
Version: {{ subject.component.project.version }}
Description: {{ subject.component.project.description }}
Project URL: {{ baseUrl }}/projects/{{ subject.component.project.uuid }}
{% if notification.subject.affectedProjects|length > 1%}

@msymons msymons added this to the 4.9 milestone Mar 7, 2023
@msymons msymons added the p3 Nice-to-have features label Mar 7, 2023
@msymons
Copy link
Member

msymons commented Mar 7, 2023

This issue was originally raised in discussion #1811

Customizable Notification Templates were introduced in v4.6 (released October 11 2022, since this enhancement was logged) but support only customization of body... with subject still being hard-coded as of v4.7.1

@JN-CSIRT
Copy link
Author

JN-CSIRT commented Mar 8, 2023

According to syalioune:

My previous answer still apply. While v4.6.0 introduced customization features, it was for the notification body content.
The notification title, thus email subject, is unfortunately still hardcoded.
Enhancement request #1823 is still valid.

@msymons
Copy link
Member

msymons commented Mar 8, 2023

@JN-CSIRT, I know this enhancement request is still valid.. that is why I have assigned it a priority and a milestone.

@JN-CSIRT
Copy link
Author

JN-CSIRT commented Mar 8, 2023

Hi Mark,
thanks a lot!

@girtsn
Copy link

girtsn commented Jun 1, 2023

Would be great to have also possibility to put severity in e-mail subject (well any field really).
Subject is very important for mail automation rules as mentioned in the discussions.

@nscuro nscuro added the good first issue Good for newcomers label Sep 16, 2023
@nscuro nscuro modified the milestones: 4.9, 4.10 Sep 16, 2023
@nscuro nscuro added the needs milestone Issues or PRs that are pending a milestone assignment label Oct 26, 2023
@nscuro nscuro removed this from the 4.10 milestone Oct 26, 2023
@nscuro nscuro removed the needs milestone Issues or PRs that are pending a milestone assignment label Feb 4, 2024
@nscuro nscuro added this to the 4.11 milestone Feb 4, 2024
@nscuro
Copy link
Member

nscuro commented Feb 7, 2024

Reopening because the original ask was for supporting templating.

@nscuro nscuro reopened this Feb 7, 2024
@nscuro nscuro removed this from the 4.11 milestone Feb 7, 2024
@nscuro nscuro added the needs milestone Issues or PRs that are pending a milestone assignment label Feb 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers needs milestone Issues or PRs that are pending a milestone assignment p3 Nice-to-have features
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants