Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
I have a content type in which i have a list where all the Roles are displayed.I want the user to select the roles from the list to which user wants to send emails.
Example : i have a list of HR, Marketing, Finance Department. So when the user Select HR and Marketing from the list it should send email to only HR and Marketing. Can any one help that how we can archive this using Rules. Help will be greatly appreciated. thanks in advance.
Comment | File | Size | Author |
---|---|---|---|
Capture.PNG | 2.93 KB | ramanmadi |
Comments
Comment #1
TR CreditAttribution: TR commentedComment #2
giorgio79 CreditAttribution: giorgio79 commentedMeh, create a View with the users you want and you can send email via a VBO...
Comment #3
TR CreditAttribution: TR commentedSeems pretty easy with Rules ... Here's how you set it up:
On your content type (I will use "Article" for convenience), add a "List (text)" field. I will call it "Department emails". Pick the "Select" widget (or "Check boxes/radio buttons" if you prefer). Set the allowed values to be your department e-mail addresses like this:
That way the actual e-mail addresses will be hidden and the department names will be shown on the content. Limit the number of selections if you want.
Now go to the manage display tab for the article content type, open the "Custom display settings" fieldset at the bottom, and check "Tokens" (and only "Tokens"). Save. Then go to the "Tokens" subtab under manage display and choose "Key" for the format of your "Department emails" field. Save.
And here's the Rule which will send email to the selected departments, whenever a new Article is created or and existing Article is updated. Choose whatever event(s) you like to trigger this as long as it provides an article node in the context.
Comment #5
TR CreditAttribution: TR commented