The Serendipity Handbook

You can now read the (german) handbook here: PDF - https://github.com/s9y/Book (LaTeX source).

Forum-Information

Before posting about errors, make sure that the answer cannot already be found in our FAQ or by searching this forum!
Posting is restricted to registered users (registering is free and simple!) due to recent spam attacks. When having trouble with this board, contact garvin(-at)s9y(-dot)org.

Board index Plugins Mailer Plugin on Edited Entries

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

Postby adedecker » Thu Mar 10, 2011 9:01 pm

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

User avatar
garvinhicking
Core Developer
 
Posts: 28971
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany

Postby garvinhicking » Fri Mar 11, 2011 12:08 pm

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 8:49 pm

Postby adedecker » Fri Mar 11, 2011 8:43 pm

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

User avatar
garvinhicking
Core Developer
 
Posts: 28971
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany

Postby garvinhicking » Mon Mar 14, 2011 4:38 pm

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/



Return to Plugins

Who is online

Users browsing this forum: No registered users and 0 guests