we're calling messaging_message_send() from a custom module that's invoked when a Rules rule is triggered. The module pulls all of the people who have flagged content in a certain way, and is intended to send them a message through the messaging framework. there may be many of these users, so we want to use messaging_message_send() since it seems to be the most appropriate for bulk sending, queuing the messages for us (there could potentially be a lot of people getting these messages).
The comments in the messaging.module say:
<?php
/*
* @param $destinations
* Array of destinations for sending.
* The element type depends on sending method so it can be a list of e-mail addresses, user accounts, etc
*/
?>I have two questions:
1) If we want to send private messages, what do we need to put in this array? Just uids, or complete user objects? or something in between? so far we've tried all of that, but we keep seeing
Message for : Subject Line Here
in the logs. There should be a username after "for" in that line.
2) If I read the comments correctly, the implication is that the end user's preferred send method isn't what's used, that it's always email or always private message, set in the call to messaging_message_send(). Is this correct?
thanks
Comments
Comment #1
friolator commentedsomething else was preventing this from working properly, and once that was cleared up, we figured out what we need to pass to this function - just uids.