Message notification via email depending on user's role
Privatemsg module has the Privatemsg Email Notification sub-module, but what if you would like to send a different email to the user to let them know of a new message received on the site depending on the user's role? This can be achieve with the Rules integration =)
Event: Privatemsg - A message is sent
Condition: User - User has role
Action: System - Send a mail to a user
Arguments configuration
>Recipient: Recipient of the message.
Now, if you are using the "Welcome message" rule and you don't want this message notification email to be sent for the Welcome message, you can add an additional condition as shown below.
Event: Privatemsg - A message is sent
Condition1: User - User has role
Condition2: Rules - Textual comparison, Negate checked
Two texts to compare:
> 1st box enter "<?php print $subject; ?>" without the quotes. This will check the subject line of the message sent against what you enter in the next box.
> 2nd box enter the subject line of your welcome message. This will make it so this rule is not fired if the message sent is your Welcome message by checking the subject line of the message sent.
Action: System - Send a mail to a user
Arguments configuration
>Recipient: Recipient of the message.
Help improve this page
You can:
- Log in, click Edit, and edit this page
- Log in, click Discuss, update the Page status value, and suggest an improvement
- Log in and create a Documentation issue with your suggestion