The Action Callback

Now that we've provide the actions subsystem with a definition of what our action will look like, we need to implement the sitenews_send_action() callback: /**

* Action: Send an email message to all users. */

function sitenews_send_action(&$object, $context) { // If not a published sitenews, skip.

if (!$object->status || $object->type != 'newsbrief') { return;

// Get addresses

."WHERE status != 0 AND uid > 0"; $results = db_query($q); $addresses = array();

while ($obj = db_fetch_object($results)) { $addresses[] = $obj->mail;

'sitenews',

'No user email addresses were found', array(),

Was this article helpful?

0 0

Post a comment