Add-on, ExpressionEngine, Email

Mail After Edit

This EE3/4/5/6/7 addon sends an email to an individual or member group after a channel entry is created or updated.

Buy Now

PURPOSE

This EE6/7 addon sends an email to an individual or member group after a channel entry is created or updated.

REQUIREMENTS

This add-on requires ExpressionEngine 6+ and PHP 7.4.

INSTALLATION

  1. Copy mail_after_edit folder to your system/user/addons folder.
  2. On your EE backend, navigate to Developer > Addons (yoursite.com/admin.php?/cp/addons).
  3. Scroll to Third Party Add-Ons.
  4. Find Mail After Edit and click Install.
  5. Add your settings, and enjoy!

NOTE: To get the most use out of Mail After Edit, turn on Entry Revisions for any channel you are looking to use MAE on.

UPGRADING

If you are upgrading from version 1, the most important thing is to leave your config.php in the addon directory. We have moved from using a file to database-driven settings, in order to make upgrading and changes simpler.

After upgrading the addon files, move your config.php file back in to the mail\_after\_edit. When you click Upgrade to 2.0, your config settings will automatically be added to the addon, and you can safely delete the file from there.

If you are upgrading to MAE v3, everything will be moved into the new channel settings set up.

SETTINGS

EMAIL

Mail After Edit utilizes EE's native emailing by default. If you are updating and were using MAE v1's Mailgun set up, you can simply move your Mailgun info into EE's email settings (/admin.php?/cp/settings/email or Settings > Outgoing Email).

Mail After Edit lets you use the EE template parser in your email settings. You can use singles and pairs with {new_entry}{old_entry}{modified}, and {values}. Grid and Relationship fields are supported, including scoped tags like {blog_video:type}.

Subject

What it does: Subject line for the email.

Templating: Parsed with EE variables. Supports singles and pairs.

  • Example: {new_entry}{title}{/new_entry} Fallback idea: Entry Updated: {new_entry}{title}{/new_entry}

Email Address

What it does: Comma-separated list of email addresses to notify.

Templating: Yes (parsed). Useful for pulling from fields.

Notes: Combined with Members, Roles, and Send to Author (see Delivery Rules below).

Members (Choose members)

What it does: Add specific site members as recipients.

Templating: No (UI selection).

Roles (Choose roles)

What it does: Add all users in selected roles as recipients.

Templating: No (UI selection).

Send to Author? (Toggle)

What it does: If enabled, includes the entry’s author email.

From Email Address

What it does: Sets the message’s From header.

Templating: Yes (parsed). Provide a valid email after parsing.

Tip: Pair with “Sending domain” so DMARC/SPF align.

Reply To Email Address

What it does: Sets the message’s Reply-To header.

Templating: Yes (parsed).

Fields To Skip

What it does: List of field names or field_id_* keys to ignore when computing changes.

Format: Comma-separated list.

  • Example: seo_title, seo_description, field_id_123

Why: Prevents noise from system/meta fields.

Send on Status Change Only?

What it does: If enabled, only sends when the entry’s status actually changes (e.g., draft → open).

Use when: You don’t want emails on minor edits.

Fields to Trigger Change

What it does: Restrict sending to changes in specific fields only.

Format: Comma-separated list of field names (preferred) or field_id_*.

  • Examples: title, blog_content, hero_image field_id_45, field_id_67

Logic:

  • If empty: any field change can trigger.
  • If set: at least one of these fields must change to send.
  • Honors Fields To Skip first.

Sending domain

What it does: The domain you intend to send from, for alignment.

Why it matters: Helps you configure SPF/DKIM/DMARC correctly. Must match the From address’ domain for best deliverability.

  • Example: yourdomain.com

Force BCC?

What it does: Sends all recipients in a single email as BCC (one message).

When to use: You want a single outbound for logging or to conceal recipient list.

Heads-up: Some mail providers may treat large BCC lists differently.

Send emails individually?

What it does: Sends one email per recipient (To header per user).

Pros: Better personalization, cleaner deliverability, easier per-recipient failure tracking.

Cons: More total messages sent.

Interaction with Force BCC:

  • If Send individually is ON, Force BCC is ignored.
  • If Send individually is OFF and Force BCC is ON, one message with BCC.
  • If both OFF, one message with all recipients in To (not recommended for privacy).

Available Template Variables

You can use these in SubjectFrom/Reply-To, and your full message template:

Pairs
  • {new_entry}...{/new_entry} — the saved entry after edit
  • {old_entry}...{/old_entry} — previous values (via versioning or incoming fallback)
  • {modified}...{/modified} — rows of changed fields: {field}{old}{new}
  • {values}...{/values} — any values you pass programmatically
Grid fields inside {new_entry} / {old_entry}

Rows are arrays; columns are available as both unscoped and scoped keys.

  • Unscoped: {type}{id}
  • Scoped: {blog_video:type}{blog_video:id}
  • Conditionals supported:

    {blog_video}
      {if type == 'youtube'}
        ...
      {/if}
      {if blog_video:type == 'vimeo'}
        ...
      {/if}
    {/blog_video}
    
Relationship fields

Each related entry is an array with core fields and custom fields, so:

{related_entries}
  <li>{title}</li>
{/related_entries}
Singles (top-level)
  • {username} — the editor’s username
  • {useremail} — the editor’s email

Practical Examples

Subject
[Updated] {new_entry}{channel_title}{/new_entry}: {new_entry}{title}{/new_entry}
From / Reply-To
From: {new_entry}{connected_email}{/new_entry}
Reply-To: support@{sending_domain}
Body with Grid
{new_entry}
  <h1>{title}</h1>
  {blog_content}

  {blog_video}
    {if type == 'youtube'}
      <iframe src="https://www.youtube.com/embed/{id}" ...></iframe>
    {/if}
    {if type == 'vimeo'}
      <iframe src="https://player.vimeo.com/video/{id}" ...></iframe>
    {/if}
  {/blog_video}
{/new_entry}

<h3>Changes</h3>
{modified}
  <p><strong>{field}</strong>
Old: {old}
New: {new}</p>
{/modified}

Delivery Rules (How recipients are combined)

Final recipient list is the union of:

  • Parsed Email Address list
  • Selected Members
  • Users in selected Roles
  • Author (if “Send to Author?” is enabled)

Then sending mode is chosen by:

  • Send emails individually? (one message per recipient) else
  • Force BCC? (single message with BCC) else
  • Single message with all recipients in To.

Tips

  • Prefer field names over field_id_* in “Fields To Skip” and “Fields to Trigger Change” when possible for readability.
  • Keep Subject templates simple; heavy logic belongs in the message body.
  • If you rely on {old_entry}, enable Entry Versioning in EE or ensure your hook provides incoming values.
  • Use a verified Sending domain and align From for best deliverability.

MESSAGE_INFO

This Contains some basic your message information

  • Start: The starting line of the email message. Defaults to An entry has been updated! See below for information.
  • End: The ending line of the email message. Defaults to Sent by Mail After Edit.
  • Domain: The full domain name that you are using, without a trailing slash. Defaults to http://example.com, so definitely change this.
  • From: This is the email your email notifications will come from. This is applied to all channels unless you override in that particular channel's config. Defaults to [email protected], so definitely change this.
  • Force BCC: This will force all emails to be sent as BCCed emails, instead of exposing emails in the To line of the email.
  • Send Individually: This will force all emails to be sent as individually. Though this does provide somme extra control, it also sends a number more emails. Use sparingly.

CHANNEL_CONFIG

This contains your channel information.

  • Channel ID: The ID of the channel you would like to set MAE up (you can )
  • Type: This can be set to email or member_group. Email is for individual email addresses that will be notified for a channel. Member Group will notify everyone who is a member of the assigned group.
  • Email: If the type is set to email, this is the email addresses you will send notifications to. Email addresses should be separated by pipes (|), i.e. [email protected]|[email protected]|[email protected]
  • Mail On: Choose the type of update to run. Can be create or edit or both. If set to create, this will send an email when an entry is created in a channel. If set to edit, it will send when an entry is updated.
  • Groups: If the type is set to member_group, this is the groups that will receive notifications re: this channel.
  • From: This is the email your email notifications will come from. This will override the MESSAGE_INFO setting

SKIP_FIELDS

These fields will be skipped in emails, as they are not used that much and will email you way too much. Defaults to entry_date and submit. Add whatever fields you like by their field name (not field label). Fields should be separated by pipes (|), i.e. entry_date|submit|super_secret_field_that_shouldnt_be_emailed|password

TEMPLATE CUSTOMIZATION

You can fully customize your mail templates, and bring in entry information. A sample template is included in this addon:

{new_entry}
    <h1>ENTRY: {title}</h1>
    {blog_content}
{/new_entry}
{old_entry}
    <h1>ENTRY: {title}</h1>
    {blog_content}
{/old_entry}

<p>USERNAME: {username}</p>
<p>USEREMAIL: {useremail}</p>

This also parses all EE fields:

{new_entry}
    <h1>ENTRY: {title}</h1>
    {blog_content}
    {blog_video}
        {if blog_video:type == 'youtube'}
            <figure class="video">
                <div class="player">
                    <iframe width="940" height="529" src="http://www.youtube.com/embed/{blog_video:id}?rel=0&controls=2&color=white&autohide=1" frameborder="0" allowfullscreen></iframe>
                </div>
            </figure>
        {/if}
        {if blog_video:type == 'vimeo'}
            <figure class="video">
                <div class="player">
                    <iframe src="//player.vimeo.com/video/{blog_video:id}?color=f0a400" width="940" height="529" frameborder="0" webkitallowfullscreen mozallowfullscreen allowfullscreen></iframe>
                </div>
            </figure>
        {/if}
    {/blog_video}
{/new_entry}
{old_entry}
    <h1>ENTRY: {title}</h1>
    {blog_content}
    {blog_video}
        {if blog_video:type == 'youtube'}
            <figure class="video">
                <div class="player">
                    <iframe width="940" height="529" src="http://www.youtube.com/embed/{blog_video:id}?rel=0&controls=2&color=white&autohide=1" frameborder="0" allowfullscreen></iframe>
                </div>
            </figure>
        {/if}
        {if blog_video:type == 'vimeo'}
            <figure class="video">
                <div class="player">
                    <iframe src="//player.vimeo.com/video/{blog_video:id}?color=f0a400" width="940" height="529" frameborder="0" webkitallowfullscreen mozallowfullscreen allowfullscreen></iframe>
                </div>
            </figure>
        {/if}
    {/blog_video}
{/old_entry}

Since the goal of the add-on is to measure entry changes, you get access to both the old entry and new entries.

SUBSCRIPTION FEATURE

The Mail After Edit addon now includes a powerful subscription system that allows site members to subscribe to specific channel entries and receive notifications when those entries are updated.

HOW IT WORKS

When the subscription feature is enabled, members can subscribe to individual channel entries. When a subscribed entry is updated, subscribers receive personalized email notifications with details about the changes made.

SETUP & CONFIGURATION

1. Enable Subscriptions Globally

Navigate to the Subscription Settings section in the Mail After Edit control panel:

  • Enable Subscriptions: Check this option to activate the subscription system globally
  • Template Customization: You can modify the default template or create custom templates for different notification types

2. Add Subscription Tag to Templates

Add the following tag to any channel entry template where you want to allow subscriptions:

{exp:mail_after_edit:subscribe entry_id="{entry_id}"}
    <div id="subscription-container">
        {if is_subscribed == 'yes'}
            <a href="{unsubscribe_url}" class="button unsubscribe-btn">Unsubscribe</a>
        {if:else}
            <a href="{subscribe_url}" class="button subscribe-btn">Subscribe</a>
        {/if}
    </div>
{/exp:mail_after_edit:subscribe}

Tag Parameters & Variables

The {exp:mail_after_edit:subscribe} tag provides the following variables:

  • {is_subscribed}: Returns 'yes' if the current member is subscribed to the entry, 'no' otherwise
  • {subscribe_url}: URL to subscribe to the entry
  • {unsubscribe_url}: URL to unsubscribe from the entry
  • entry_id: Required parameter to specify which entry to check subscription status for

ADMIN MANAGEMENT

Subscriptions Menu

Navigate to Subscriptions in the Mail After Edit control panel to:

  • View all active subscriptions across your site
  • See which members are subscribed to which entries
  • Remove individual subscriptions manually
  • Monitor subscription activity and engagement

Subscription Settings Menu

Use the Subscription Settings section to:

  • Global Toggle: Enable or disable the entire subscription system
  • Template Management: Select and customize email templates for notifications

EMAIL NOTIFICATIONS

When subscriptions are enabled and a subscribed entry is updated:

  1. Automatic Detection: The system automatically detects when a subscribed entry is modified
  2. Change Tracking: Detailed information about what fields were changed is included
  3. Personalized Emails: Each subscriber receives an individual notification
  4. Template-Based: Notifications use your configured email templates
  5. Bypass Regular Notifications: When subscribers exist, regular channel notifications are bypassed to avoid duplicate emails

MEMBER EXPERIENCE

Subscribing:

  • Members click the "Subscribe" button on any entry with the subscription tag
  • Immediate confirmation of subscription status
  • No page reload required (AJAX-based)

Unsubscribing:

  • One-click unsubscribe from any subscribed entry
  • Instant status update
  • Members can manage their own subscriptions

Notifications:

  • Receive detailed emails when subscribed entries are updated
  • See exactly what changed in the entry
  • Includes entry information and update details

TECHNICAL NOTES

  • Member Authentication: Only logged-in members can subscribe to entries
  • Compatibility: Works alongside existing Mail After Edit notification settings
  • Priority Logic: When subscriptions exist for an entry, they take priority over general channel notifications

LOGGING

By default, Mail After Edit will add data to your Developer logs, so you can track your emails. If, for whatever reason, it is unable to access the developer logging, MAE will create a small file in your MAE directory. You can access this file via the MAE settingsdashboard.

EXTENSION HOOKS

Sometimes a user may want to check if certain fields are set, or set to certain values, or some other random condition. We have added extension hooks to help with this very thing:

mail_after_edit_should_send_create

This checks with the same data as the after_channel_entry_insert hook, $entry, $entryData.

mail_after_edit_should_send_create

This checks with the same data as the after_channel_entry_update hook, $entry, $values, $modified.

TROUBLESHOOTING

  1. Check your EE Mail settings and send a test email.
  2. Check the developer logs/MAE logs. Check to see if any EE mailer errors had occurred in there.
  3. Contact support for any additional assistance.

USE

Set it and forget it! Once you have all the information in your settings, it will automatically send the email anytime an entry in that particular channel is created or updated.

SUPPORT

We want to make sure you have what you need on this. Head to https://docs.triplenerdscore.net/project/mail-after-edit for docs, and https://github.com/dougblackjr/tns-ee-addons for support!

ATTRIBUTIONS

ICON: The Mail After Edit icon is too awesome to be my own work. Icons made by surang from www.flaticon.com