Mailer Plugin on Edited Entries

Creating and modifying plugins.
Post Reply
adedecker
Posts: 3
Joined: Thu Mar 10, 2011 7:49 pm

Mailer Plugin on Edited Entries

Post by adedecker »

I've been using the mailer plugin for a certain amount of time. I'd now like to be able to edit entries frequently and be emailed on each edit. I seem to only get the email messages when the initial entry is created. Subsequent edits do not result in emails. The "Send this entry via E-mail" button is checked at the bottom of the entry when it is saved. Is there a simple line I can comment out that might skip and edit/create entry check and email out regardless (provided the selection button is clicked)?

We're using Serendipity 1.5.5, and the FCKEditor as the WYSIWYG editor though I don't think that factors in.

Thanks
Andy
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: Mailer Plugin on Edited Entries

Post by garvinhicking »

Hi!

To force re-sending, you can save your entry as draft, save it, and then immediately switch to "publish" again and save again. This will re-force all "publish" actions, like sending out email notifications.

Otherwise you would need to replace "backend_publish" with "backend_save" inside the plugin file.

HTH,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
adedecker
Posts: 3
Joined: Thu Mar 10, 2011 7:49 pm

Re: Mailer Plugin on Edited Entries

Post by adedecker »

Thanks Garvin. This worked, though I had to add 'backend_save' to 'backend_publish' (as opposed to replacing it) to ensure that that emails go out on both initial post and future edits. However, this does break the concept of a draft in that all drafts are now sent out as emails. Is there an additional check I can add that would detect the status of the Draft/Publish selection (which we could use to skip the emailing in those cases?)

Thanks
Andy
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: Mailer Plugin on Edited Entries

Post by garvinhicking »

Hi!

Yes, I think you should be able to check if $eventData['isdraft'] equals true, and then do the appropriate actions...

HTH,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
Post Reply