Email HTML Notifications

Is there a way to send html email notifications when certain things happen like on order has been acknowledged and a shipment notification saying your shippent has been sent

1 Like

A BPM should work for this. I have sent many email alerts using BPMs.

The default format of emails is TEXT.

If you want HTML, you need to format the body with HTML Tags

NewEmailBody = "<html><body><pre style='font: monospace'>";
NewEmailBody = NewEmailBody + "<style>table, th, td {border: 1px solid black;border-collapse: collapse; font-family: monospace; font-size: 12px;}";
NewEmailBody = NewEmailBody + "th, td {padding: 5px;text-align: left;}</style>";
.... the html formatted body goes here ....
NewEmailBody = NewEmailBody + "</pre></body></html>";

and you have to specify that it’s HTML

> message.IsBodyHtml = true;

Don’t forget to β€˜clean’ any text before appending it to the NewEmailBody. A β€˜<’ in a part description can fubar the HTML. So replace β€˜<’ with β€˜&lt;’, β€˜>’ with β€˜&gt;’, etc …

Edit: the <style> … </style> is just to set how tables look.

Edit #2: also scrub ampersands, replacing β€˜&’ with β€˜&amp;’

4 Likes

See the BPM_EmailExample at

3 Likes

For E9,
You may want to use smtpmail.p instead of the Epicor one. It is a lot more extensive and it can do MIME types so you can set it to HTML, although you will need to do the encoding.

In E9 you can do BAMs and use alerts to call an ABL program, but for upgrade purposes I’d avoid it and use a BPM, but use the code button (right hand bottom) when you go to add the BPM action. If you do a search there are a few examples in the archives if I recall.

Also be wary of the recipient address displaying incorrectly on the email, If I recall it truncates everything after the @. Once agian there is post around, If I recall you need to add a > to the end of the email address string.

Here is a related post

I there are other ways like coding it as a customization on the specific form or using C# in some other fashion with BPMs, but apart from create Case Closure reports and emailing them on the HDCase form I have never done the .Net method through a BPM in E9, I don’t recall seeing anything in the guides either. Happy for someone to point me to it if there is a reference.

If it is for E10 then listen to those that are more versed in it them myself.

Apologies if the information is a bit vague, but I am not in front of a working system at the moment.

Hope it helps.