novuhq / novu

Open-Source Notification Platform. Embeddable Notification Center, E-mail, Push and Slack Integrations.
https://novu.co
Other
34.73k stars 3.55k forks source link

[NV-1240] ๐Ÿš€ Feature: Ability to set specific Email Headers (to track campaigns) #1949

Open mediana opened 1 year ago

mediana commented 1 year ago

๐Ÿ”– Feature description

Different email providers proposes to add custom headers when sending campaigns to better track them (by allowing to group messages). It also permits getting statistics and so on. For instance, Mailjet documentation explains their implementation : https://dev.mailjet.com/smtp-relay/custom-headers/ Also, for SendGrid : https://docs.sendgrid.com/for-developers/sending-email/building-an-x-smtpapi-header#categories

๐ŸŽค Why is this feature needed ?

In my case, I could implement this to have greater segmentation over smtp relay usage.

โœŒ๏ธ How do you aim to achieve this?

Ability to set these custom header (param + value) per email notification template. Also, ability to override these settings (or values only) by the payload of a Novu API trigger.

๐Ÿ”„๏ธ Additional Information

Custom headers could look like this : X-Mailjet-Campaign: โ€œName of my campaignโ€œ

๐Ÿ‘€ Have you spent some time to check if this feature request has been raised before?

๐Ÿข Have you read the Code of Conduct?

Are you willing to submit PR?

No response

NV-1240

scopsy commented 1 year ago

Thanks for the report @mediana ๐Ÿ™ Will try to take a closer look at this later.

oba2311 commented 1 year ago

Hi @mediana thanks for this!

We are looking at custom layouts right now so I'm wondering whether creating your own layout could solve for this? Let's work together to understand how this can be tackled soon ๐Ÿ‘

mediana commented 1 year ago

Hello @oba2311 How can I help ?

scopsy commented 1 year ago

I think the easiest way for now to achieve this would be with overrides object during trigger. And later perhaps add it to the template editor. @mediana wdyt about this approach

mediana commented 1 year ago

@scopsy This approach looks interesting indeed. Iโ€™ve checked the documentation about this. Though, I canโ€™t find an example on how to use this, and how the object to input looks like. Do you mind providing such an example, so I can test this and give you a feedback. Maybe the doc can already be updated with this information.