Sales Order emails - using templates  Topic is solved

Discussions relating to Jiwa 7 plugin development, and the Jiwa 7 API.

Sales Order emails - using templates

Postby DannyC » Thu Oct 04, 2018 11:22 am

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
User avatar
DannyC
Senpai
Senpai
 
Posts: 718
Joined: Fri Mar 22, 2013 12:23 pm
Topics Solved: 31

Re: Sales Order emails - using templates

Postby Scott.Pearce » Thu Oct 04, 2018 11:31 am

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.
Scott Pearce
Senior Analyst/Programmer
Jiwa Financials
User avatar
Scott.Pearce
Senpai
Senpai
 
Posts: 765
Joined: Tue Feb 12, 2008 11:27 am
Location: New South Wales, Australia
Topics Solved: 230

Re: Sales Order emails - using templates  Topic is solved

Postby Mike.Sheen » Wed Nov 28, 2018 3:26 pm

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.
Attachments
Plugin Add to email footers Image and URL.xml
(25.6 KiB) Downloaded 214 times
Mike Sheen
Chief Software Engineer
Jiwa Financials

If I do answer your question to your satisfaction, please mark it as the post solving the topic so others with the same issue can readily identify the solution
User avatar
Mike.Sheen
Overflow Error
Overflow Error
 
Posts: 2583
Joined: Tue Feb 12, 2008 11:12 am
Location: Perth, Republic of Western Australia
Topics Solved: 807


Return to Technical and or Programming

Who is online

Users browsing this forum: No registered users and 3 guests