Retrieving and Parsing Email Templates in Code  Topic is solved

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

Retrieving and Parsing Email Templates in Code

Postby pricerc » Mon Apr 01, 2019 8:31 pm

I'd like to hijack sales order email templates for my own nefarious purposes.

I've found
Code: Select all
JiwaFinancials.Jiwa.JiwaEmailTemplates.EmailTemplate
in my object browser, but I'm not seeing a method for applying a template to a SalesOrder.

Is there something public, or do I need to roll my own?
/Ryan

ERP Consultant,
Advanced ERP Limited, NZ
https://aerp.co.nz
User avatar
pricerc
Senpai
Senpai
 
Posts: 518
Joined: Mon Aug 10, 2009 12:22 pm
Location: Auckland, NZ
Topics Solved: 21

Re: Retrieving and Parsing Email Templates in Code  Topic is solved

Postby Mike.Sheen » Thu Apr 04, 2019 11:38 am

That is a project we were never given the time to finish.

We aim was to have a unified email template for use everywhere that sends emails - including sales orders, similar to what we have for Creditor Cheque Payment Email Templates - with a HTML preview and other such fanciness.

So, yes you'll need to roll your own.
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

Re: Retrieving and Parsing Email Templates in Code

Postby pricerc » Thu Apr 04, 2019 11:44 am

Mike.Sheen wrote:That is a project we were never given the time to finish.

We aim was to have a unified email template for use everywhere that sends emails - including sales orders, similar to what we have for Creditor Cheque Payment Email Templates - with a HTML preview and other such fanciness.

So, yes you'll need to roll your own.


Cool. I already started.

But instead of your pre-defined list of fields, I'm making use of FormatWith from James Newton-King (of JSON.NET fame); a very simple but effective regex-based thing that I started using way back, way before interpolated strings, that uses format strings that look a bit like interpolated strings. http://james.newtonking.com/archive/200 ... -variables.

It means you can use pretty much any field in the object you're dealing with, or it's related parents and children.
/Ryan

ERP Consultant,
Advanced ERP Limited, NZ
https://aerp.co.nz
User avatar
pricerc
Senpai
Senpai
 
Posts: 518
Joined: Mon Aug 10, 2009 12:22 pm
Location: Auckland, NZ
Topics Solved: 21


Return to Technical and or Programming

Who is online

Users browsing this forum: No registered users and 3 guests