Skip to content

Email Template En

Email Template Configuration

We can standartize emails using the Email Template doctype in ERPNext

To access the Email Template list, go to:

Home > Settings > Email > Email Template

How to create or edit an Email Template

  1. Go to the Email Template doctype

  2. Pick a created template or press on the “Add Email Template” button

  3. Enter the subject for the email template

  4. Enter the body of the email template

  5. Press the “Save” button

    Screen1

You can use Jinja tags to get better control over the letter body and make the body more dynamic. You can use Jinja documentation.

Leave Aproval Norification Example

For instance we need to edit the Leave Aproval Notification template so it contain a link to Leave Approval List.

  1. Select the Leaeve Approval List template

  2. In the “Response” form after the table type this:

    {% set doc_link = frappe.utils.get_url_to_form('Leave Application', name) %}
    {{ _('Open Now') }}
    • The doc_link variable is created by the set keyword and it contains the url of the Leave Application doctype of certain name collected by frappe.utils.get_url_to_form()
    • We use {{ _(‘Open Now’) }} to make a text that would be a link to a Leave Application
  3. Highlight the {{ _(‘Open Now’) }} text and select the link option in the toolbar

  4. In the Enter link form write {{ doc_link }}

    Toolbar

  5. Press the “Save” button

Employee weill recieve such a message

Message

Interview Feedback Example

For instance we need to edit the Interview Feedback template so it contain a link to the Interview doctype and the name of the job applicant.

  1. Select the Interview Feedback Reminder template

  2. Change the “Response” form so it looks like this:

    Interview Feedback Reminder
    {% set doc_link = frappe.utils.get_url_to_form('Interview', name) %}
    {% set job_appl = frappe.db.get_value('Interview', name, 'job_applicant') %}
    {% set applicant_name = frappe.db.get_value('Job Applicant', job_appl, 'applicant_name') %}
    {% set applicant_designation = frappe.db.get_value('Job Applicant', job_appl, 'designation') %}
    Interview Feedback for Interview {{ name }} of {{ applicant_designation }} {{ applicant_name }} is not submitted yet. Please submit your feedback. Thank you, good day!
    • We created a link to the current Interview doctype using the frappe.utils.get_url_to_form(‘Interview’, name)
    • job_appl variable contains the job applicant indicated in the current Interview
    • applicant_name variable contains the name of the job applicant that was collected from the Job Applicant doctype using frappe.db.get_value
    • applicant_designation variable contains a designation of the job applicant that was collected from the Job Applicant doctype using frappe.db.get_value
    • After this we write the body of the email message with the {{ applicant_designation }} and {{ applicant_name }} variables to indicate applicant’s name and designation in the text
  3. Press the Save button

Interviewer will recieve such a message:

interviewer_message