Page 1 of 1

Sales Order emails - using templates

PostPosted: Thu Oct 04, 2018 11:22 am
by DannyC
version 7.2

Instead of tweaking the Sales Order Custom Email to adjust the body, subject etc of the sales order email, how would we go about using the Email Templates module to pick up a specific template?
I'm assuming the PDF attachment would still get attached?

I have a client who's asked about the possibility of changing the message body willy nilly, for marketing campaigns, seasonal phrases (Merry Xmas etc...) and I thought that would be a good way. If they type in a URL, would it appear in an email as a hyperlink?

cheers
Danny

Re: Sales Order emails - using templates

PostPosted: Thu Oct 04, 2018 11:31 am
by Scott.Pearce
Email templates are stored in the table EM_Templates. To keep it simple, you could simple provide a lookup or combobox to allow them to select a template (having read a list of them from EM_Templates). When they select a template, you simple place EM_Templates.EmailBody value into the text control of the email dialog.

Re: Sales Order emails - using templates  Topic is solved

PostPosted: Wed Nov 28, 2018 3:26 pm
by Mike.Sheen
DannyC wrote:If they type in a URL, would it appear in an email as a hyperlink?

cheers
Danny


Any URLs will only appear as URLs if you override the BodyIsHTML property of the email message to true and you format the URLs as per the HTML spec:
Code: Select all
<a href="http://www.thisistheurl.com/page">This is the text which will appear as a URL</a>


An example plugin showing how to add an image and url to all emails by making them HTML is attached.