# Adding fields to email templates

From the Field Picker dropdown default or custom fields can be chosen to get the snippet of the Velocity markup needed to extract the value of the field.&#x20;

However, it does not render the complete HTML structure that you may need to keep the correct layout of the HTML content in your email body. The reason is that when developing a new template you might want to have your custom HTML structure and layout.

If you develop a template based on the custom Jira Email This Issue or the default templates of Jira, you can use the following HTML markup to add your fields:

**Example HTML markup for adding fields to your email templates**

```
#if($!issue.getCustomFieldValue('customfield_12345'))
<tr>
    <th>
        Name of the customfield_12345:
    </th>
    <td>
		#renderCustomField($issue, 'customfield_12345')
    </td>
</tr>
#end
```

### Rich Text content in fields

JEditor allows you to enter Rich Text content in custom fields. In order to render Rich Text fields in email in Jira 6.x and later versions, you must add the following lines to your template:

```
#set ($fieldValueInHtml = $!jetiFieldRenderer.renderCustomField($issue, 'customfield_12345'))
$fieldValueInHtmle
```

{% hint style="success" %}
**Result**: Using this technique the HTML content of the field value will not be escaped.
{% endhint %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.meta-inf.hu/email-this-issue/email-this-issue-for-jira-server-data-center/documentation/outgoing-emails/email-templates/adding-fields-to-email-templates.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
