diff --git a/erpnext/docs/assets/img/setup/email/email-alert-condition.png b/erpnext/docs/assets/img/setup/email/email-alert-condition.png new file mode 100644 index 00000000000..8ede0112c59 Binary files /dev/null and b/erpnext/docs/assets/img/setup/email/email-alert-condition.png differ diff --git a/erpnext/docs/assets/img/setup/email/email-alert-subject.png b/erpnext/docs/assets/img/setup/email/email-alert-subject.png new file mode 100644 index 00000000000..671de9bcef7 Binary files /dev/null and b/erpnext/docs/assets/img/setup/email/email-alert-subject.png differ diff --git a/erpnext/docs/user/manual/en/setting-up/email/email-alerts.md b/erpnext/docs/user/manual/en/setting-up/email/email-alerts.md index f4cccd3ef34..1a5d13ab17f 100644 --- a/erpnext/docs/user/manual/en/setting-up/email/email-alerts.md +++ b/erpnext/docs/user/manual/en/setting-up/email/email-alerts.md @@ -28,6 +28,41 @@ To setup an Email Alert: 1. Set the recipients of this alert. The recipient could either be a field of the document or a list of fixed email ids. 1. Compose the message + +### Setting a Subject +You can retrieve the data for a particular field by using `doc.[field_name]`. To use it in your subject / message, you have to surround it with `{{ }}`. These are called [Jinja](http://jinja.pocoo.org/) tags. So, for example to get the name of a document, you use `{{ doc.name }}`. The below example sends an email on saving a Task with the Subject, "TASK##### has been created" + +Setting Subject + +### Setting Conditions + +Email alerts allow you to set conditions according to the field data in your documents. For example, if you want to recieve an Email if a Lead has been saved as "Interested" as it's status, you put `doc.status == "Interested"` in the conditions textbox. You can also set more complex conditions by combining them. + +Setting Condition + +The above example will send an Email Alert when a Task is saved with the status "Open" and the Expected End Date for the Task is the date on or before the date on which it was saved on. + +### Setting a Message + +You can use both Jinja Tags (`{{ doc.[field_name] }}`) and HTML tags in the message textbox. + +

Order Overdue

+ +

Transaction {{ doc.name }} has exceeded Due Date. Please take necessary action.

+ + + {% if comments %} + Last comment: {{ comments[-1].comment }} by {{ comments[-1].by }} + {% endif %} + +

Details

+ + + + --- ### Example