Closed (fixed)
Project:
Scheduler
Version:
7.x-1.1
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
2 Jul 2013 at 18:58 UTC
Updated:
10 Nov 2013 at 11:46 UTC
Jump to comment: Most recent
Once a scheduled unpublish occurs on a content item via the Schedule module, I would like to send out an email to the content owner to let them know that their content has been unpublished (or is about to be unpublished). Any ideas on how to accomplish this? I would expect I might be able to do this via Rules, but if someone could lend some guidance, that would be great.
Comments
Comment #1
jonathan1055 commentedHi Joshua,
If you have your own custom module in which you can implement hooks, then you can do it using hook_scheduler_api() and hook_mail().
hook_scheduler_api() accepts two parameters - $node is the node object being processed, and $action is either 'publish' or 'unpublish'
drupal_mail() calls the specified hook_mail() function given by the first parameter.
hook_mail() defines values for the subject, body, etc
Hope that gives you some ideas. I've not tested the above php, although I have copied this from various different bits of working code. If you want to try it, let me know and I'm happy to help some more.
Jonathan
Comment #2
joshua.boltz commentedThanks. After more investigating, I may be able to figure out a solution using Rules, but if that fails, I will definitely give this option a try.
Comment #3
jonathan1055 commentedOK that's fine.
For the record, and my own interest, I checked out my idea above, and here is a working version, in case anyone else needs this:
Jonathan
Comment #4
jonathan1055 commentedHi Joshua,
I have now started on the Rules Integration for Scheduler, and provided two default reaction rules, which do exactly this.
See #773510: Integration with Rules module
Comment #6
jonathan1055 commented