Field names for Email Templates

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

Field names for Email Templates

Postby pricerc » Fri Jul 03, 2026 4:06 pm

https://jiwa.atlassian.net/wiki/spaces/J8UG/pages/1399947266/Email+Templates refers.

I have some old templates that need converting to the new templates.

I see that the new 'tokens' are basically C# snippets.

Are there any guides/cheat sheets for getting started and identifying what's in scope (Other than the Object Browser and ILSpy) ?

'No' is an acceptable answer, I just don't want to spend a whole lot of time re-inventing the wheel.
/Ryan

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

Re: Field names for Email Templates

Postby Mike.Sheen » Mon Jul 06, 2026 10:41 am

Each field in the template is a C# script expression, and we use Microsoft.CodeAnalysis.CSharp.Scripting.CSharpScript.EvaluateAsync() to execute that, and we pass a Jiwa business logic object as the globals parameter, which is defined as "An object instance whose members can be accessed by the script as global variables."

In the case of a sales order email template, the globals is the Sales Order business logic (an instance of the JiwaFinancials.Jiwa.JiwaSales.SalesOrder.SalesOrder class) - so you have access to all the properties of the sales order business logic for sales order email templates.
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: 2604
Joined: Tue Feb 12, 2008 11:12 am
Location: Perth, Republic of Western Australia
Topics Solved: 817


Return to Technical and or Programming

Who is online

Users browsing this forum: No registered users and 2 guests