Question

We're using organic groups, and we'd like to notify an administrator every time someone joins a group.

At the moment, we've set up a trigger for this, and set up an action to send an email. We're using the %username token in the email, but this refers to the username of the person who created the group in the first place, not the username of the person joining.

Is there any way to send an email that includes the username of the person who is joining the group?

Was it helpful?

Solution

I nice and simple way of accomplishing this will be to download the token (http://drupal.org/project/token) module. Once you've downloaded the token module be sure to enable token and token_actions module.

The token module will give you more "tokenize" options besides the default %username.

Now instead of creating a "send email" action create a "send tokenize email" action, this is going to give you a lot more token options to choose from.

The two options we care about are [author-mail] and [mail], in your case author-mail is the group manager email address and [mail] is the email address of the user that's joining the groups.

So add [author-mail] to the recipient option in the action and [mail] to where ever in the body you want to put it.

Now all you have to do is go to the Organic Group trigger page and add the new action we created to the "New user joins a group" trigger. That should do it. If you can't seem to be able to add that option to the trigger check out the triggerunlock module (http://drupal.org/project/triggerunlock) which will fix that problem for you.

Hope this helps.

Licensed under: CC-BY-SA with attribution
Not affiliated with drupal.stackexchange
scroll top