I have a case where I need to add some extra params and vars to the userpoints messages, but can't seem to come up with a way to do this.
It would be nice if there was an alter hook in this function to allow modules to add their own vars and params.
To be more specific, when a user has content flagged as abusive, the content is unpublished and the user loses points. If the loss of those points causes the user to leave a role, an email is sent to that user informing him or her that they lost points and lost their role. I also want to be able to tell the user which node was flagged as abusive that caused this loss.
I know I can implement hook_mail_alter(), but I can't seem to come up with a way to figure out what user is getting the notification, because the uid doesn't get passed into the mail function. I can't look up the user from "To" address, as I don't always have the email address (Facebook Connect).
The userpoints_role_send_mail() function has the user account when it sets up the $vars and $params, and if I could alter these params to add my own, that would help, especially if the $account object was passed along:
drupal_alter('userpoints_role_send_mail', $account, $vars, $params);
Comments
Comment #1
ebeyrent commentedOr better yet, strip out this functionality in favor of Rules integration to make this process a bit more configurable.
Comment #2
berdirPatches are welcome. Note that patches against 7.x have a much better chance of being commited.
The 6.x branch of this project is not much more but a collection of unmaintained modules and most of them are in a rather sad state.