Entry Update Notification 2.0
This extension allows you to send customized notification emails when entries are edited. You can specify whether notifications are triggered through CP edits, SAEF edits or both. You dedicate a template among your site templates to serve as the notification template. In that template you can have any EE tags you like and you can feed to those tags the entry id of the entry that was edited. Additionally, you can specify different weblogs and different settings per weblog.
Parameters
Instead of parameters, this extension has settings that are editable in the extensions manager of the CP.
- To Email
- From Name
- From Email
- Subject
- Notification Template
- Blurb Field
- Template Parse Method
- Email Format
- Word Wrap
- Notify the Author of the Entry?
- Notify on Control Panel Edits?
- Notify on Stand Alone Entry Form edits?
- Entry Template
To Email
The email address to receive notifications when weblog entries are edited. Separate multiple values with commas.
From Name
The name from which notifications are sent.
From Email
The email address from which notifications are sent.
Subject
The email subject displayed in the notification email.
Notification Template
The template used for generating the notification. This settings allows you to indicate which of your site templates to use for notification formatting.
Blurb Field
The custom weblog field with the content you want displayed in the notification email. This is the {blurb} variable available in your notification template.
Template Parse Method
This settings controls how to parse the given template. Choices are Xhtml, Auto <br />, or none.
Email Format
This setting controls whether to send HTML or plain text emails.
Word Wrap
The 'word_wrap' setting allows you to control the word wrapping option of notification emails. Indicate 'yes' to leave word wrap on and 'no' to turn it off. Default is 'no'.
Notify the author of the entry?
This setting sends a notification to the author of the weblog entry when it is edited.
Notify on control panel edits?
This setting sends a notification when a weblog entry is edited from the control panel.
Notify on Stand Alone Entry Form edits?
This setting sends a notification when a weblog entry is edited from the front-end.
Entry Template
The template path that will generate a URL in the notification. This is the {url} variable available in your notification template.
Variables
These variables are available for use in your notification template. There is NO parameter necessary for the Entry Update Notification template.
title
{title}
The {title} variable is that of the weblog entry which is being edited, and is available only in your notification template.
blurb
{blurb}
The {blurb} variable is the custom weblog field that contains the description or blurb content of the weblog entry which is being edited, and is available only in your notification template. This is the pre-selected custom weblog field you designated in the Entry Update Notification extension settings.
url
{url}
The {url} variable is the URL path to the weblog entry in the notification email. This is the pre-selected site template you designated in the Entry Update Notification extension settings. Note: This variable builds the complete path to the entry, using the site template you specified.
entry_id
{entry_id}
The {entry_id} variable is an alternative to using the {url} variable. Should there be any reason you prefer to hard code your URL path to the weblog entry in the notification email, specify the full URL path and ad the {entry_id} variable to the end of the URL path.
Examples
Notification Template Examples:
<div>Hello!</div>
<div>{title} has recently been updated.</div>
<div>{blurb}</div>
<div>You can view the entry here:
<a href="{url}">Check it!</a></div>
<div>Hello!</div>
<div>{title} has recently been updated.</div>
<div>{blurb}</div>
<div>You can view the entry here:
<a href="http://www.example.com/template/{entry_id}/">Check it!</a></div>
Extension Hook
You need to add the extension hook seen below to your cp.publish.php file under this line of code around line 4340 in ExpressionEngine 1.6.4 in the submit_new_entry() function.
Look for these lines:
/** ------------------------------------
/** Delete categories
/** ------------------------------------
// We will resubmit all categories next
$DB->query("DELETE FROM exp_category_posts WHERE entry_id = '$entry_id'");
The hook (place directly after code above):
// -------------------------------------------
// 'submit_new_entry_edit_existing_end' hook.
// - Execute action on updates
//
if (isset($EXT->extensions['submit_new_entry_edit_existing_end']))
{
$edata = $EXT->call_extension('submit_new_entry_edit_existing_end', $entry_id, $data, $cp_call);
if ($EXT->end_script === TRUE) return;
}
//
// -------------------------------------------