I am writing an extension for EE 1.x that will trigger an action (specifically, send email to members of a newsgroup) in the following scenarios: 1) when a new entry is published to a specified channel with status ‘open’ OR 2) when an existing entry in that channel is edited and its status field changed to ‘open’.
For the second scenario, I need to check the actual status field value of an entry undergoing edit from the control panel. Does the $data array contain $data[“entry_id”] ?
The first scenario can be trapped using the ‘submit_new_entry_end’ hook, and I can test $data[“weblog_id”] and $data[“status”] and test $IN->GBL(‘C’) == ‘publish’.
For the second scenario, also plan to use ‘submit_new_entry_end’ hook with testing $IN->GBL(‘C’) == ‘edit’ . I plan to query the database for exp_weblog_titles for that entry_id to fetch the current status of the entry. Is there an easier way or is this on-track?
Thanks, Aharon
Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.