Entry Update Notification 2.1
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?
- Ignore These Member Groups
- Ignore These Statuses
- 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.
Ignore These Member Groups
Selecting any of the Member Groups will exempt members of that member group from notifications.
Ignore These Statuses
Selecting any of the Statuses will exempt entries of that status from generating notifications.
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.
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.
entry_id
{entry_id}
The 'entry_id' variable is an alternative to using the 'url' or 'url_entry_id' variables. 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.
screen_name
{screen_name}
The 'screen_name' variable will output the screen name of the member who edited the weblog entry.
title
{title}
The {title} variable is that of the weblog entry which is being edited, and is available only in your notification template.
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 with URL Title, using the site template you specified.
url
{url_entry_id}
The 'url_entry_id' 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 with Entry ID, using the site template you specified.
url_title
{url_title}
The 'url_title' variable is an alternative to using the 'url' or 'url_entry_id' variables. 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 {url_title} variable to the end of the URL path.
weblog_id
{weblog_id}
The 'weblog_id' variable outputs the Weblog ID of the entry edited. A typical usage here would be if you wanted to generate a URL to the CP Publish/Edit page.
Examples
Notification Template Examples:
<h2>Hello!</h2>
<p>{title} has recently been updated by {screen_name}.</p>
<p>{blurb}</p>
<p>You can view the entry here:
<a href="{url}">Check it!</a></p>
<h2>Hello!</h2>
<p>{title} has recently been updated by .</p>
<p>{blurb}</p>
<p>You can view the entry here:
<a href="http://www.example.com/template/{entry_id}/">Check it!</a></p>
<p>Or you can edit the entry here:
<a href="http://www.example.com/system/index.php?S=0&C=edit&M=edit_entry&weblog_id={weblog_id}&entry_id={entry_id}">Edit this Entry!</a></p>
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.x 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'");
And then add the following code directly below:
//—————————————————————-
// 'submit_new_entry_edit_existing_end' hook by SOLSPACE
// - 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;
}
//
//—————————————————————-