Loading ...

Take and update message from Email Templates

Hello. There is a article about how to Take and update message from Email Templates add make a custom click link for that email
First of all, You need to take Email from Message Email Templates by this way
var notification = (Notification)PXSelect<Notification, Where<Notification.notificationID, Equal<Required<Notification.notificationID>>>> .Select(Base, 14);

Then to select text from this Notification object by doing this. We are converting it to text from HTML text to operate with it.
var emailText = Tools.ConvertHtmlToSimpleText(notification.Body).TrimStart();


Before adding a custom link don’t forget to convert text to HTML. And then just replace text with HTML code.


To attach file for email, we could do next thing
I created method to convert any file to a byte array


And then in AddAttachment just using name of file that I need and converting it to byte array and attaching it to email.



After that you will have a custom link and also attached file in email body

Currently rated 5.0 by 1 people

  • Currently 5.0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5