I am using Aspose.Network (Ver: 3.8.0.0). I am using the TemplateEngine to "merge" a MailMessage and DataTable together. I works great !!!!. The replacement tokens in the subject line and body of the message are being replaced just fine. (Ex: Token: #Firstname# being replaced with Don).
My problem. I need to create a custom header with a value from the DataTable, but it doesn't appear the TemplateEngine does token replace for Headers.
I would like the TemplateEngine to do token replace in the headers.
TemplateEngine engine = new TemplateEngine(message);
MailMessageCollection messages;
messages = engine.Instantiate(<<>>);
When I review the messages in the message collection, the Header EmailEventID has #EmailEventID# as it's value instead of the value 12345679 from the DataTable.
Suggestion for Aspose.....Please enable token replacements in the Header.
Thanks. That's great to hear. I'm pretty much dead in the water without it unless there is another way to uniquely identify MailMessages using a user generated unique key. Basically, I read data from a database, then, once the email is sent, I need to update the database that it was send or failed and why. Using BulkSend, if an error occurred and the SmtpFailedBulkSendException is raised with the failed messages in the FailedSentMessages collection, there's no way to uniquely identify the messages with the database key so I can log the error.
Until the token replacement for headers has been deployed, do you have any suggestions?
TemplateEngine engine = new TemplateEngine(message);
MailMessageCollection messages;
messages = engine.Instantiate(<<>>);
When I review the messages in the message collection, the Header EmailEventID has #EmailEventID# as it's value instead of the value 12345679 from the DataTable.