Hi,
I've implemented a List-Unsubscribe into a delivery template in the 'Additional SMTP headers' section.
It did work as expected but since I want it in all my delivery templates I wish to add it using a Typology rule.
I saw in the documentation that it is possible but couldn't figure out exactly how to do it using a Typology rule.
Does someone know how it can be achieved?
Thanks,
Sagi
Solved! Go to Solution.
Views
Replies
Total Likes
Hi Sagi,
You can use a code inside typology rule
delivery.mailParameters.headers inside the JS code will give you all the headers.
If you do a split
var headerLines = headers.split("\n");
you get an array of headers.
Create your custom header as
var newHeaderLine = header + ": " + value;
Add the new header line to the array
headerLines.push(newHeaderLine);
Finally, join them and assign to the main parameter
delivery.mailParameters.headers = headerLines.join("\n")
Regards,
Vipul
Views
Replies
Total Likes
Hi Sagi,
You can use a code inside typology rule
delivery.mailParameters.headers inside the JS code will give you all the headers.
If you do a split
var headerLines = headers.split("\n");
you get an array of headers.
Create your custom header as
var newHeaderLine = header + ": " + value;
Add the new header line to the array
headerLines.push(newHeaderLine);
Finally, join them and assign to the main parameter
delivery.mailParameters.headers = headerLines.join("\n")
Regards,
Vipul
Views
Replies
Total Likes
Hi Vipul,
Thanks for your answer, it helped
Cheers,
Sagi
Views
Replies
Total Likes
Hi Vipul,
I want to add a list unsubscribe header by using a typology rule useing this snippet.
There seems to be something wrong with the syntax, could you please look into this?
delivery.mailParameters.headers
var headerLines = headers.split("\n");
var newHeaderLine = header + ":mailto: " + errorAddress + "?subject=unsubscribe" + message.mimeMessageId;
headerLines.push(newHeaderLine);
delivery.mailParameters.headers = headerLines.join("\n")
Best regards
Niels
Views
Replies
Total Likes
Views
Likes
Replies