30 days free. No credit card. Full access from the moment you connect your site.

Start free trial

Get Contact Form Mail Template

Every Contact Form 7 form carries two mail templates. mail is the notification that goes to the site when someone submits. mail_2 is the autoresponder that goes back to the visitor, and it is inactive by default.

contact-form-7/get-mail returns either one in full: recipient, sender, subject, body, additional headers, attachments, and the flags that control HTML and blank-value handling.

At a glance

Abilitycontact-form-7/get-mail
ToolsetContact Form 7 — toolset/contact-form-7
GroupContact Form 7 › Mail & Notifications
RequiresContact Form 7, active on the site
Capabilitymanage_options, plus read_contact_forms
SafetyRead-only — changes nothing
RepeatableIdempotent — running it twice leaves the same result
Ships inAcrossAI Abilities Manager 0.0.34 and later

How it works

The body is where mail tags live — [your-name], [your-email] and so on. Each one has to match a field the form actually has, and nothing enforces that, so reading the body and the field list together is how you spot a break.

The exclude_blank flag decides whether an empty value leaves a blank line in the notification or is dropped entirely. It is the reason a missing value can be hard to notice.

Reading mail_2 on a form that has never used the autoresponder returns the template anyway, marked inactive. An empty inactive template is normal, not a fault.

Input

NameTypeRequiredWhat it is
form_idintegerYesForm post ID, as returned by contact-form-7/list-forms.
whichstringNo — defaults to mailmail is the notification sent to the site; mail_2 is the optional autoresponder sent to the visitor.

What comes back

NameTypeWhat it is
form_idintegerThe form the template belongs to.
whichstringWhich template was returned.
mailobjectRecipient, sender, subject, body, headers, attachments and flags.
successbooleanWhether the call completed.
messagestringA one-line summary of what happened, suitable for showing a human.
error_codestringPresent only on failure — a stable machine-readable reason, such as a missing field, a wrong field type or an unmet confirmation.

Example

Ask your assistant:

Where do submissions from form 42 actually go?

It resolves to one call:

{
  "ability": "contact-form-7/get-mail",
  "parameters": {
    "form_id": 42,
    "which": "mail"
  }
}

Worth knowing

  • Read this before writing. contact-form-7/update-mail merges, but you still want to know what a body references before you change a field.
  • An inactive mail_2 is the default state, not a misconfiguration.
  • To check the body’s tags against the form’s real fields, use contact-form-7/validate-mail-tags.

Related abilities


Get the plugins:
AcrossAI Abilities Manager · AcrossAI MCP Manager

Browse the rest: Every ability, by category


Keep reading