Skip to content

Email Footer Configuration En

Places where you can change Email Footer

System Settings

There is an Email option in System Settings doctype where you can change standard email footer of organisation:

  • Write your own footer via HTML tags
  • Disable Standard Email Footer
  • Hide footer in auto email reports
  • Send document Web View link in email

![](./assets/system_settings_footer_example.png”>

Email Account

In Email Account doctype you can create new or choose existing email account. Each account has Footer option where you can change email footer for this certain account.

Using the toolbar, you can change the text font, size, color, insert links and images into the text. For example, a footer created using the toolbar might look like this:

![](./assets/email_account_standard_footer.png”>

Also you can cahnge footer via html-tags:

![](./assets/email_account_footer_example.png”>

(If you add some text in Email Account footer with enabled Standard Email Footer there would be two footers)

HTML Templates

In Frappe for each doctype there is HTML Template so is for Email Footer. You can find Email Footer template in file system of your site by this path:
/workspace/development/frappe-bench/apps/frappe/frappe/templates/emails/email_footer.html

In email_footer.html there are three blocks: email_account_footer, sender_adress, default_mail_footer.

![](./assets/email_footer_html.png”>

So we can change Email Account footer and Standard Footer from within frappe via HTML and Jinja.

In email_footer.html there is default_mail_footer block which looks like this:

<!-- default_mail_footer -->
{% if default_mail_footer %}
<div class="default-mail-footer">
{% for line in default_mail_footer %}
<div>{{ line }}</div>
{% endfor %}
</div>
{% endif %}

So in this block piece of information about default mail footer is collected via Jinja. To add your information some HTML and Jinja knowledge is required. Now we need to get some information abount current user.

If you need to get full name of current user you must use frappe.get_fullname() function like this:

<b>{{ frappe.get_fullname() }}</b>

<b></b> - paragraph tag

Now we need to get designation field of current user so we can use this information in default footer. To get this field in Jinja API there are few usefull functions:

  • frappe.get_all

    frappe.get_all(doctype, filters, fields, order_by, start, page_length, pluck)
    Returns a list of all records of a DocType. Only returns the document names if the fields argument is not given.
  • frappe.get_list

    frappe.get_list(doctype, filters, fields, order_by, start, page_length)
    Similar to frappe.get_all but will filter records for the current session user based on permissions.

Full documentation of Jinja API for Frappe you can find by this link: https://frappeframework.com/docs/v14/user/en/api/jinja#frappeget_url

To get designation field we’ll use frappe.get_list() (it can collect information about current session user):

{% set user_designation = frappe.get_list('Employee', fields=['designation']) %}
{{ user_designation[0]['designation'] }}

We created variable user_designation which contains frappe.get_list(‘Employee’, fields=[‘designation’]) via set keyword. In frappe.get_list function was specified ‘Employee’ doctype as first parameter and ‘designation’ field in fields as second parameter. So now user_designation variable contains information about designation field of current user.

We can show this information in our footer via {{ user_designation[0][‘designation’] }} It means from user_designation list we take 0 element and from this element we take value by designation key

We can use <br> tag to define a single line break

To paste link on the Your Site resource we use <a href=""></a> tag like this:

<a href="www.yoursite.com">Your Site</a>

href here is atribute of <a> tag in which you can paste url of certain site

We take the code in <div></div> tag to define container and use class keyword to name a block custom-footer so we know this is our block. We use <font></font> tag to change font style, size etc. So our block looks like this:

<div class="custom-footer">
<font color="black" style="font-family: 'helvetica'; font-size: 13px;">
Best regards, <br>
<b>{{ frappe.get_fullname() }}</b>
<br>
{% set user_designation = frappe.get_list('Employee', fields=['designation']) %}
{{ user_designation[0]['designation'] }} |
<a href="www.yoursite.com">Your Site</a>
<br>
Your Site Address
<br>
<img src="your/site/logo/path" alt="logo" width="30" height="30">
</font>
</div>

The look of whole custom-footer block

Now we have the whole default_mail_footer looks like this:

<!-- default_mail_footer -->
{% if default_mail_footer %}
<div class="default-mail-footer">
<div class="custom-footer">
<font color="black" style="font-family: 'helvetica'; font-size: 13px;">
Best regards, <br>
<b>{{ frappe.get_fullname() }}</b>
<br>
{% set user_designation = frappe.get_list('Employee', fields=['designation']) %}
{{ user_designation[0]['designation'] }} |
<a href="www.yoursite.com">Your Site</a>
<br>
Your Site Address
<br>
<img src="your/site/logo/path" alt="logo" width="30" height="30">
</font>
</div>
{% for line in default_mail_footer %}
<div>{{ line }}</div>
{% endfor %}
</div>
{% endif %}

Using ! tag you can add an image in your footer via url of some logo.