I would like to use the fep_shortcode_new_message_form shortcode to create a message form that will send a message to multiple recipients. I tried a comma separated list of wordpress usernames in the to field but that did not work. Is this possible?
If the shortcode does not support multiple users in to, would it be possible to add the users using the fep_action_message_after_send hook i.e. insert post_meta data to add that particular message ID to other users inbox?
This shortcode does not support multiple recipient.
You can use fep_action_message_after_send hook to set participants to other user but may encounter some caching issue with message count. Instead You can use fep_filter_message_before_send and pass message_to_id as array of user ids. remember it already holds current recipient (may be as string), so add only other users.
So basically, change $message_to_id to an array of user ids. Do I need to return $message_to_id from the function or is it just enough to change it? Are there 3 parameters on _before_send like there are on after_send?
I presume that once multiple participants have been added, any future replies will go to everyone i.e. if I send the first message to two people, if one of those 2 people respond, I receive it and the other person from the 2 receive it? Or, is it the case that the _before_send hook has to everytime a reply is sent, work out the to list?
Out of interest, is it possible to use the fep_filter_message_before_send filter to also halt/abort creation of the message by manipulating the variables within its scope? I am wondering if I could within this filter check that something related to my app is correct and if not abort creation of the message.