Email Template Cheat Sheet

Last updated: 25 September 2023 at 16:43:21 UTC by Junari Assistant

Editing dynamic email templates (templates with fields) can be a little tricky - there are a lot of fields in the system and the trick is knowing the correct one to add!


Note: It's a good idea to duplicate templates when editing via the 'Action' button so you always have a copy of the original!



Common Fields


Here are a few common fields, which should work for templates in most areas of the system


Contact Name

e.g. the name of the main Customer / Contact on a Sales Order or Enquiry


Use: ${object.partner_id.name}


Current Record reference

e.g. the current Sales Order number or enquiry reference


Use either: ${object.name}  or  ${object.ref}   (depending on the type of record)


The current user's name, phone number and email address

If you want to include details about the current user in the email


Use:

${user.name}

${user.phone}

${user.email}


The current user's email signature

If you want to include the current user's email signature in an email template


Use: ${user.signature | safe}



Using the "Placeholder Generator"


The Email Template screen has a "Dynamic Placeholder Generator" tab.


This allows to you search for the field you want to add to your template, and it generates the placeholder text for you to paste into your template, as shown in the example below:




Using the 'Preview'

To preview email templates against different records click the 'Preview' button at the top right of the templatee




Choose a record you would like to preview from the first dropdown box and the email will be previewed below



Update the Date format on the email template:


You can update the date format on the email template using this: ${object.event_id.create_date.strftime('%d/%m/%Y')}.