mail.template: fields, relations and API
The mail.template model ("Email Templates") is a persistent model declared by the Discuss module, then extended by 3 other modules. It exposes 35 fields, 26 of them declared directly on the model; 35 fields from other models point to it. Below you will find every field with its technical name, type, label and relations, followed by an Odoo 19 JSON-2 API call.
Model identity
- Technical name
mail.template- Label
- Email Templates
- Type
- Persistent (models.Model)
- SQL table
mail_template- Origin module
- Discuss (
mail) - Extended by
- account, event, pos_self_order
- Default order (_order)
user_id, name, id- Inherits from (mixins)
- mail.render.mixintemplate.reset.mixinpos.load.mixin
Model fields
26 own fields, 3 inherited from mixins and 6 automatic ORM fields. Click a name to get a direct link to that field.
35 of 35 fields shown
| Technical name | Label | Type | Details |
|---|---|---|---|
| active | Active | boolean | |
| attachment_ids | Attachments | many2many | |
| auto_delete | Auto Delete This option permanently removes any track of email after it's been sent, including from the Technical menu in the Settings, in order to preserve storage space of your Odoo database. | boolean | |
| body_html | Body | html | translatable |
| can_write | Can Write The current user can edit the template. | boolean | computed |
| description | Template Description This field is used for internal description of the template's usage. | text | translatable |
| email_cc | Cc Carbon copy recipients (placeholders may be used here) | char | |
| email_from | Send From Sender address (placeholders may be used here). If not set, the default value will be the author's email alias if configured, or email address. | char | |
| email_layout_xmlid | Email Notification Layout | char | |
| email_to | To (Emails) Comma-separated recipient addresses (placeholders may be used here) | char | |
| has_dynamic_reports | Has Dynamic Reports | boolean | computed |
| has_mail_server | Has Mail Server | boolean | computed |
| is_template_editor | Is Template Editor | boolean | computed |
| mail_server_id | Outgoing Mail Server Optional preferred server for outgoing mails. If not set, the highest priority one will be used. | many2one | |
| model | Related Document Model | char | read-only related: |
| model_id | Applies to | many2one→ ir.model | |
| name | Name | char | translatable |
| partner_to | To (Partners) Comma-separated ids of recipient partners (placeholders may be used here) | char | |
| ref_ir_act_window | Sidebar action Sidebar action to make this template available on records of the related document model | many2one | read-only |
| reply_to | Reply To Email address to which replies will be redirected when sending emails in mass; only used when the reply is not logged in the original discussion thread. | char | |
| report_template_ids | Dynamic Reports | many2many | |
| scheduled_date | Scheduled Date If set, the queue manager will send the email after the date. If not set, the email will be send as soon as possible. You can use dynamic expression. | char | |
| subject | Subject Subject (placeholders may be used here) | char | translatable |
| template_category | Template Category | selection | computed Values: |
| use_default_to | Default Recipients Default recipients of the record: - partner (using id on a partner or the partner_id field) OR - email (using email_from or email field) | boolean | |
| user_id | Owner | many2one | |
| lang | Language Optional translation language (ISO code) to select when sending out an email. If not set, the main partner's language will be used. This should usually be a placeholder expression that provides the appropriate language, e.g. {{ object.partner_id.lang }}. | char | inherited from mail.render.mixin |
| render_model | Rendering Model | char | computed inherited from mail.render.mixin |
| template_fs | Template Filename File from where the template originates. Used to reset broken template. | char | inherited from template.reset.mixin |
| create_date | Created on | datetime | read-onlyautomatic |
| create_uid | Created by | many2one | read-onlyautomatic |
| display_name | Display Name | char | read-onlycomputedautomatic |
| id | ID | integer | read-onlyautomatic |
| write_date | Last Updated on | datetime | read-onlyautomatic |
| write_uid | Last Updated by | many2one | read-onlyautomatic |
Relations
Models linked from this model
- ir.actions.act_window: ref_ir_act_window
- ir.actions.report: report_template_ids
- ir.attachment: attachment_ids
- ir.mail_server: mail_server_id
- ir.model: model_id
- res.users: user_id
Fields of other models pointing here
- account.move.send.wizard: template_id
- applicant.get.refuse.reason: template_id
- calendar.alarm: mail_template_id
- event.track.stage: mail_template_id
- fleet.vehicle.send.mail: template_id
- gamification.challenge: report_template_id
- hr.applicant.refuse.reason: template_id
- hr.recruitment.stage: template_id
- ir.actions.server: template_id
- loyalty.mail: mail_template_id
- loyalty.program: mail_template_id
- mail.activity: mail_template_ids
- mail.activity.type: mail_template_ids
- mail.compose.message: template_id
- mail.composer.mixin: template_id
- mail.template.preview: mail_template_id
- mail.template.reset: template_ids
- pos.preset: mail_template_id
- product.template: email_template_id
- project.project.stage: mail_template_id
- project.task.type: mail_template_id, rating_template_id
- res.company: stock_mail_confirmation_template_id
- res.config.settings: cart_recovery_mail_template, confirmation_email_template_id, invoice_mail_template_id
- sale.order: pending_email_template_id
- sale.order.template: mail_template_id
- slide.channel: completed_template_id, publish_template_id, share_channel_template_id, share_slide_template_id
- survey.survey: certification_mail_template_id
- website: cart_recovery_mail_template_id, confirmation_email_template_id
Reading this model through the API
Odoo 19 JSON-2 API call reading the first five records with real fields of the model. Replace the instance, database and API key with your own.
curl -X POST "https://your-instance.odoo.com/json/2/mail.template/search_read" \
-H "Authorization: bearer $ODOO_API_KEY" \
-H "X-Odoo-Database: your-db" \
-H "Content-Type: application/json" \
-d '{"domain":[],"fields":["name","mail_server_id","model_id","ref_ir_act_window","user_id"],"limit":5}'import requests
BASE_URL = "https://your-instance.odoo.com/json/2"
headers = {"Authorization": f"bearer {API_KEY}", "X-Odoo-Database": "your-db"}
res = requests.post(
f"{BASE_URL}/mail.template/search_read",
headers=headers,
json={"domain": [], "fields": ["name","mail_server_id","model_id","ref_ir_act_window","user_id"], "limit": 5},
)
res.raise_for_status()
print(res.json())- External API access requires Odoo's Custom plan.
- XML-RPC and JSON-RPC will be removed in Odoo 22 (fall 2028): use JSON-2.
- The access rights and record rules of the key's user apply.
Cite this tool
Writing a tutorial, internal documentation or a forum answer? Copy this link to send your readers to the up-to-date reference.
<a href="https://aidoo.ai/en/outils/explorateur-modeles-odoo/mail-template">mail.template (Odoo 19.0)</a>Sources
Data verified on September 23, 2026 · Odoo 19.0 Community
Have an Odoo project, or want to put your ERP to work with AI? Let's talk
Implementation, custom module development, connecting Claude or ChatGPT to your data: tell us about your context and we will reply within 24 business hours.