Docs & Support

Learn about all the Formidable features and get support from our amazing customer success team.

frm_email_message

Heads up!
This article contains PHP code and is intended for developers. We offer this code as a courtesy, but don't provide support for code customizations or 3rd party development.

This hook can be used to edit or replace the message body of an email sent by a form.

Usage

add_filter('frm_email_message', 'add_email_header', 10, 2);
function add_email_header($message, $atts)

Formidable Forms makes advanced site building simple. Launch forms, directories, dashboards, and custom WordPress apps faster than ever before.

Parameters

  • $message (string)
  • $atts (array)

Examples

Add Header Image to Emails

You can use the example below to add a static image header to all emails sent from your forms. Replace the URL below with an image URL of your choice.

add_filter('frm_email_message', 'add_email_header', 10, 2);
function add_email_header($message, $atts) {
 //edit the email header image source to include an image URL of your choice
 $email_header = '<img src="http://www.yoursite.com/images/email-header.jpg" alt="Header" /><br />';
 $message = $email_header . $message;
 return $message;
}

Add a preheader

For a clear and concise summary displayed next to your subject line, use this code snippet to add a preheader to your emails.

add_filter('frm_email_message', 'add_email_header', 10, 2);
 function add_email_header($message, $atts) {
     if (isset($atts['form']) && $atts['form']->id == 1) { //replace 1 with the ID of the form
         $email_header = 'This is the preheader text';
         $message = $email_header . $message;
     }
     return $message;
 }

Change Log

Added in version 2.0.11

Was this article helpful? *

This article may contain affiliate links. Once in a while, we earn commissions from those links. But we only recommend products we like, with or without commissions.

In this article

    We have a small, but amazing team of dedicated people who are committed to helping you achieve your goals and project requirements.


    Copyright © 2025 Strategy11, LLC. Formidable Forms® is a registered trademark Strategy11, LLC.

    Complete your purchase
    Special offer unlocked.
    Get 55% OFF!
    Complete Purchase
    Join 400,000+ using Formidable Forms to create form-focused solutions fast. Get Formidable Forms