96
Views
6
Comments
Solved
Adding custom header to outgoing email based on Dev, Test or Production environment

Hi folks,


I've got a problem that I just cant work out, and am looking for any suggestions possible.

I'm working on a system that currently has over 46 different emails across a number of applications.
Each of these emails use a common template for layout (it's a webblock), but the contents are managed in the individual applications.

We are using the OutSystems provided email sending features, and the messages are being sent through sendgrid, using the apikey, password technique that is pretty common.  The Dev and Test environments use the "Redirect to Test list" for redirecting the emails to Dev and Test email boxes in Exchange.  This means, Dev, Test and Production all address messages to the actual intended recipients, but the Dev and Test environments get delivered to the Dev and Test email inboxes.

Our requirement is that emails from the production environment need to be forwarded to an additional recipient for auditing purposes.  Dev and Test emails are NOT to be forwarded to the Audit email address.

Our Exchange admins have set up some Mail Transport rules to capture emails addressed to the nominated inboxes we need to monitor.  However, these look at the addresses on the message, not the addresses the email is delivered to.  As such, we're forwarding the Production, Test AND Dev emails to be audited, which is not correct.


What we would like to do is add a custom header to the Dev and Test emails, which identifies these messages NOT to be forwarded.


Is there a way, from the email template (i.e. the webblock) that we can add a custom header to the email message?

Does anyone have a suggestion that isn't "update  the properties on all the emails with your custom header"?

Does anyone else wish that Outsystems had a module that had an "AddMimeHeader" which would update the mime header on the email being sent out, if it had the webblock in it?


Thanks for your time.

2020-06-27 18-35-53
Rohan Hanumante
Solution

Hi @John Porra,

You can achieve this by setting the one Site Property for the audit email address which will be used in every email sending as in BCC. You can set this Site Property for production env. but not for your Dev, test etc. 

I hope that help...

 

2018-06-07 22-34-06
John Porra

Still means I have to manualy change each email to use this property, and remember to add it into any new emails.
Thanks for your suggestion, I'll bring it to the team for consideration.


2024-07-05 14-16-55
Daniël Kuhlmann
Ā 
MVP

No you understand wrong. The site property is a configuration per environment. So all mails of dev use one setting. All mails in production use the value of the site property as set in server center of the production environment.

That said, outsystems allows to define a test distribution email list to override the email receipents in non-production environments, because normally you do never want to sent emails from dev or test to real users. This is especially more important in UAT environments that might have the same users defined as production.

Regards,

Daniel

2024-07-05 14-16-55
Daniël Kuhlmann
Ā 
MVP
Solution
2022-12-30 09-46-57
Deepika Patel

Hi @John Porra,

My understanding is that you want to forward the production email to another recipient with a different subject line for auditing purposes once it is sent. Do I understand this correct?

Regards,

2018-06-07 22-34-06
John Porra

Not exactly.

We want the 3 environments to send exactly the same email, we just want the Dev and Test emails to be "identifiable" via an email header, so we can intercept them, and NOT include them in the audit.

We can't add something special to the production emails, because we regularly get emails that need to be lodged into the audit system from our customers too.  These emails would therefore NOT have the same identifiers.

We need the subject line to remain intact.


We were hoping there was a module/feature where we could add an email header to a message if it contained our common mail template block (i.e. via it's preparation)

I hope this helps answer your question.

2020-06-27 18-35-53
Rohan Hanumante
Solution

Hi @John Porra,

You can achieve this by setting the one Site Property for the audit email address which will be used in every email sending as in BCC. You can set this Site Property for production env. but not for your Dev, test etc. 

I hope that help...

 

2018-06-07 22-34-06
John Porra

Still means I have to manualy change each email to use this property, and remember to add it into any new emails.
Thanks for your suggestion, I'll bring it to the team for consideration.


2024-07-05 14-16-55
Daniël Kuhlmann
Ā 
MVP

No you understand wrong. The site property is a configuration per environment. So all mails of dev use one setting. All mails in production use the value of the site property as set in server center of the production environment.

That said, outsystems allows to define a test distribution email list to override the email receipents in non-production environments, because normally you do never want to sent emails from dev or test to real users. This is especially more important in UAT environments that might have the same users defined as production.

Regards,

Daniel

2024-07-05 14-16-55
Daniël Kuhlmann
Ā 
MVP
Solution
Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.