Page 1 of 1

Mail Plugin -- "Not immediate but when public"

Posted: Sun Oct 08, 2006 7:40 am
by mastergaurav
Hi,

What I want to achieve is as follows:

Whenever a new entry is 'made available' from s9y, it should be sent to an email specified.

I found the 'Mail' plugin however the problem is that it would send an email immediately as one does 'Save'.

Whereas, what I want is that the mail should be sent only when the entry is 'made available' or updated. Specifically, the scenario when I have disabled future entries to be shown immediately but to be shown only when 'that time' arrives.

I know, it is not a trivial job because this requires some kind of a timer that is always in action in background. Probably can be done via a cron job but doesn't suit hostings where the server is not dedicated but shared --- like the case of my hosting.

I am not quite sure if that is achievable directly... or by some tweak?



Cheers,
Gaurav Vaish
http://www.mastergaurav.com
http://www.edujinionline.com

Posted: Sun Oct 08, 2006 4:11 pm
by dcigary
I wanted to do a similar thing, but to send an email to a mailing list. You're right, the email option supplied with S9Y didn't quite do what I wanted, so I hacked up a solution that seems to work.

I used rss2email to key off the RSS feed to determine when something was published. I've got it checking once an hour in a cron job, and when there's a new entry, it sends an email to a list I have defined. Out of the box, rss2email will put in the entire entry, but I didn't want that - I only wanted it to notify that something was available and provide a link to the entry. I modifed their code to just put in text stating that a new entry is available, and provide a link.

It seems to work pretty well, so maybe this might be a good stop-gap solution for you until there's an official S9Y plug-in or something...

Posted: Wed Oct 11, 2006 8:40 pm
by judebert
The problem is the asynchronous nature of the update. rss2email fixes that by updating at specified intervals. S9Y can't guarantee that its users will have that capability -- for instance, many servers don't allow access to cron or crontab -- so we can't guarantee anything at a future date.

We can do things when we're called, such as when a user clicks a button or visits the website. That's how the "future entry" thing works: if the user is visiting at a time before the post date, we don't show it; if the user visits after the post date, we do show it. But we don't get notified at the post time and make changes, or anything like that.

Until we can figure out some way to be called at an arbitrary time, you're best off using an external service for that kind of thing.

Posted: Wed Oct 11, 2006 8:46 pm
by garvinhicking
Hi Judebert!

BTW, we do have a "cronjob" event plugin that emulates a cronjob, but is based on visitors coming to your site to trigger conrjobs. :)

Best regards,
Garvin