We use cookies to improve your experience. No personal information is gathered and we don't serve ads. Cookies Policy.

ExpressionEngine Logo ExpressionEngine
Features Pricing Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University
Log In or Sign Up
Log In Sign Up
ExpressionEngine Logo
Features Pro new Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University Blog
  • Home
  • Forums

Extension: Update Message

Development and Programming

Laisvunas's avatar
Laisvunas
879 posts
16 years ago
Laisvunas's avatar Laisvunas

The attached add-on files may be out of date. Please visit Devot-ee for the latest versions.

There are already at least six add-ons which send email notification when an entry is created, updated or deleted:

1) UpdateMail 2) Entry Update Notification 3) NSM Publish Plus 4) Snitch 5) Snitch Member Groups 6) Entry Mailing

No of these add-ons fitted my purposes since I need

1) to specify which entries email notifications should inform about; that is I need to specify that email notification should be sent in case an entry is posted into certain weblog or category or has certain status or is authored by certain member.

2) to be able very flexibly form URLs - as flexibly as in Entry Crumblink extension.

To meet these requirements I created Update Message extension which sends email notifications when entry is updated, created or deleted only if entry meets certain criteria (weblog and category or status or author id) and allows very flexible forming of entry’s URL.

Flexibility in forming entry’s URL is achieved using special URL templates for each weblog.

EMAIL SUBJECT AND MESSAGE VARIABLES

1) action - outputs “created” or “updated” or “deleted”; 2) weblog_url - outputs weblog URL as defined in CP Home > Admin > Weblog Administration > Weblog Management > Edit Weblog Preferences 3) url_title 4) url - outputs result of parsing URL template in case URL template is not empty or otherwise - a concatenation of the values of the variables “weblog_url” and “url_title”; 5) entry_id 6) title 7) status 8) categories - outputs comma delimited list of categories into which entry is submitted; 9) screen_name - outputs screen name of user who performed the action; 10) email - outputs email of user who performed the action; 11) weblog_id 12) weblog_title

Conditionals are supported for each of these variables.

URL TEMPLATES’ VARIABLES: SINGLE VARIABLES WITHOUT PARAMETERS

1) {site_id} 2) {site_url} 3) {site_index} 4) {homepage} 5) {weblog_id} 6) {weblog_short_name} 7) {weblog_url} - weblog URL as defined in weblog preferences 8) {entry_id} 9) {url_title} 10) {categories_number} 11) {category_levels_number}

Templates support huge number of variables of the types outlined below (level0 is the highest level of categories, level1 is the level of subcategories of highest level, etc.; category0 is the first category of certain level, category1 is the second category, etc.):

11) {level0_category0_cat_id}, {level0_category1_cat_id}, {level0_category2_cat_id} … {level1_category0_cat_id}, {level1_category1_cat_id}, {level1_category2_cat_id} … {level99_category99_cat_id}.

12) {level0_category0_parent_id}, {level0_category1_parent_id}, {level0_category2_parent_id} … {level1_category0_parent_id}, {level1_category1_parent_id}, {level1_category2_parent_id} … {level99_category99_parent_id}.

13) {level0_category0_group_id}, {level0_category1_group_id}, {level0_category2_group_id} … {level1_category0_group_id}, {level1_category1_group_id}, {level1_category2_group_id} … {level99_category99_group_id}.

14) {level0_category0_cat_url_title}, {level0_category1_cat_url_title}, {level0_category2_cat_url_title} … {level1_category0_cat_url_title}, {level1_category1_cat_url_title}, {level1_category2_cat_url_title} … {level99_category99_cat_url_title}.

15) {level0_category0_subcats_number}, {level0_category1_subcats_number}, {level0_category2_subcats_number} … {level1_category0_subcats_number}, {level1_category1_subcats_number}, {level1_category2_subcats_number} … {level99_category99_subcats_number}.

Continued in the next post

       
Laisvunas's avatar
Laisvunas
879 posts
16 years ago
Laisvunas's avatar Laisvunas

URL TEMPLATES’ VARIABLES: SINGLE VARIABLES HAVING PARAMETERS

1) {single_field} variable can have following prarameters:

1) field
2) entry_id
3) weblog
4) url_title
5) category - category id
6) sort - "asc" or "desc"
7) format - field format (e.g. "none", "raw")

This variable can be used to output the vavue of some custom field. Parameters do not support pipe character and “not”.

2) {entries_number} variable can have following prarameters:

1) weblog
2) category
3) url_title
4) status
5) entry_id
6) show_expired

This variable can be used to output number of entries posted into certain weblog or category. Parameters do not support pipe character and “not”.

3) {php} variable which can have following parameters:

1) string - string to be run through PHP function
2) function - PHP function name
3) par1 - first argument of PHP function
4) par2 - second argument of PHP function
5) par3 - third argument of PHP function
6) par4 - fourth argument of PHP function
7) par5 - fifth argument of PHP function

Names of PHP functions which can be used as values of “function” parameter are: addcslashes, bin2hex, chop, chr, chunk_split, convert_cyr_string, convert_uudecode, convert_uuencode, count_chars, crc32, crypt, echo, explode, get_html_translation_table, hebrev, hebrevc, html_entity_decode, htmlentities, htmlspecialchars_decode, htmlspecialchars, join, levenshtein, localeconv, ltrim, md5_file, md5, metaphone, money_format, nl_langinfo, nl2br, number_format, ord, parse_str, print, printf, quoted_printable_decode, quotemeta, rtrim, setlocale, sha1_file, sha1, similar_text, soundex, sprintf, sscanf, str_ireplace, str_pad, str_repeat, str_replace, str_rot13, str_shuffle, str_split, str_word_count, strcasecmp, strchr, strcmp, strcoll, strcspn, strip_tags, stripcslashes, stripos, stripslashes, stristr, strlen, strnatcasecmp, strnatcmp, strncasecmp, strncmp, strpbrk, strpos, strrchr, strrev, strripos, strrpos, strspn, strstr, strtok, strtolower, strtoupper, strtr, substr_compare, substr_count, substr_replace, substr, trim, ucfirst, ucwords, vfprintf, vprintf, vsprintf, wordwrap.

Also the value of “function” parameter can be “parseint”; it is custom PHP function which behaves as Javascript “parseInt” function.

Single variables having parameters are parsed after single variables which do not have parameters; that means that you can use single variables without parameters as the values of parameters.

EXAMPLES OF USAGE

Here is URL template for one of my weblogs:

{homepage}/site/news/{url_title}/

Here is more complicated URL template:

{if level0_category0_cat_id == "170" OR level0_category0_cat_id == "175" OR level0_category0_cat_id == "176" OR level0_category0_cat_id == "177"}{homepage}/technical/entry/{url_title}/{/if}

Another quite complicated URL template example:

{homepage}/ebook/general_introduction/{level1_category0_cat_url_title}/{if "{entries_number weblog="ebook_generalintro" category="{level1_category0_cat_id}"}" > 1}{url_title}/{/if}
       
russlipton's avatar
russlipton
305 posts
16 years ago
russlipton's avatar russlipton

Is it possible to email the contents of a custom field with a message variable? I am thinking ‘not’, but intensely hoping you would offer such support.

       
Laisvunas's avatar
Laisvunas
879 posts
16 years ago
Laisvunas's avatar Laisvunas

Hi Russ,

There is already an add-on which allows to send contents of custom field inside email notification - Entry Mailing.

       
russlipton's avatar
russlipton
305 posts
16 years ago
russlipton's avatar russlipton

I own Entry Mailing. Like all of Silenz’s work, it is excellent. I can indeed include custom field content in a mailing. However, Entry Mailing is best suited for newsletters. It is channel-centric and one can only define a single mailing format per single channel at-a-time.

Update Message is mailing list centered and richly parameterized. It will allow me to flexibly notify subgroups/members in a fine-grained fashion. Though each list may only have one defined rule-set to qualify its recipients, I can map a common set of parameters to many different types of entries (and URLs).

There will undoubtedly be some overlap between the two addons if custom field content can be mailed with Update Message. Still, I feel they are disjunct enough to render my request reasonable.

It also seems ideal (and even more, appropriate) for a notification addon to allow designers to decide which of their custom field(s) contain data that should be made visible in the email - to determine the boundary between appropriate notification content and appropriate site content.

However you choose, I continue to be amazed at the unique (and uniquely powerful) niche occupied by your addons. I will be in despair if you do not port them to 2.0 ASAP. Well, okay, maybe despair is a bit strong …. 😉

       
Laisvunas's avatar
Laisvunas
879 posts
16 years ago
Laisvunas's avatar Laisvunas

Hi Russ,

I really do not see a point for having possibility to send content of custom field inside email notification. If there is a URL inside it, then the person receiving email can click on it and see all rendered page.

       
russlipton's avatar
russlipton
305 posts
16 years ago
russlipton's avatar russlipton

No worries. It’s great work - thanks.

       
Filippo_Me's avatar
Filippo_Me
50 posts
16 years ago
Filippo_Me's avatar Filippo_Me

Hi,

I’m interest about send an email notification to a specific email address (content in each weblog entries).

For example:

Weblog ‘Person’ with filed (Name, Surname, Status, Email).

When I change the ‘status’ filed I want send an email to the address ‘email’.

It’s possible? Any other idea?

       
Laisvunas's avatar
Laisvunas
879 posts
16 years ago
Laisvunas's avatar Laisvunas
When I change the ‘status’ filed I want send an email to the address ‘email’.

If I understood you correctly, you need to send e-mail notification not when the entry is submitted, but when the entry’s status is changed to status “filed”?

       
Filippo_Me's avatar
Filippo_Me
50 posts
16 years ago
Filippo_Me's avatar Filippo_Me

Yes, exactly!

In particular when the ‘published’ FIELD change to ‘yes’.

Thank you!

       
Laisvunas's avatar
Laisvunas
879 posts
16 years ago
Laisvunas's avatar Laisvunas

Hi,

In particular when the ‘published’ FIELD change to ‘yes’.

I again don’t understand what you exactly mean: change of the status value into “filed” or change of custom field value into “filed”?

       
mark59's avatar
mark59
88 posts
15 years ago
mark59's avatar mark59

Just installed this extension - on a site running EE 1.6.8 and having issues.

When I submit the notification settings and ‘update settings’ - the return screen is blank and nothing is updated - if I go back to settings nothing is set. Something appears to be broken.

Would like to get this working as I have a client updating the site and it would be nice to know which items they have recently added/updated.

       
Laisvunas's avatar
Laisvunas
879 posts
15 years ago
Laisvunas's avatar Laisvunas

Hi Mark,

When I submit the notification settings and ‘update settings’ - the return screen is blank and nothing is updated - if I go back to settings nothing is set. Something appears to be broken.

Which exactly page does nor work? Can you post full breadcrumbs path which is displayed on top of the page?

       
james Brown's avatar
james Brown
492 posts
15 years ago
james Brown's avatar james Brown

Hi Laisvunas- I’m having a little difficulty determining if your extension is what I need for a problem I am trying to solve. Here is what I want to happen:

A user submits a weblog entry. It gets a “Draft” status. An admin then reads through the submitted entries and either sets their status to “Open” or “Rejected”. If it has a status of “Rejected”, then the admin should be able to have the option of sending out an email to the author with an explanation as to why it was rejected. This functionality would need to be available in both the individual edit individual entry screen and the edit multiple entries screen.

Is this something your extension can do?

       
Laisvunas's avatar
Laisvunas
879 posts
15 years ago
Laisvunas's avatar Laisvunas
A user submits a weblog entry. It gets a “Draft” status. An admin then reads through the submitted entries and either sets their status to “Open” or “Rejected”. If it has a status of “Rejected”, then the admin should be able to have the option of sending out an email to the author with an explanation as to why it was rejected. This functionality would need to be available in both the individual edit individual entry screen and the edit multiple entries screen. Is this something your extension can do?

When a user submits ans entry admin will receive a message containing info about the entry. Then admin can do what he wishes.

       
1 2

Reply

Sign In To Reply

ExpressionEngine Home Features Pro Contact Version Support
Learn Docs University Forums
Resources Support Add-Ons Partners Blog
Privacy Terms Trademark Use License

Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.