I am trying to set-up an action to send an email to all users with role editor. I am using [user:roles:editor:mail] but that does not seem to work. Adding an actual email works so the system is set-up properly for sending emails. The help screen doesn't show this token either. What it lists under Users > Roles doesn't make any sense to me.

Is it possible to send an email to all users with a specific role this way? Any pointer on how to get this going is very much appreciated.

Comments

saurabh.dhariwal’s picture

For you purpose you can achieve this easily by rules.

{ "rules_role_message" : {
    "LABEL" : "role message",
    "PLUGIN" : "reaction rule",
    "OWNER" : "rules",
    "REQUIRES" : [ "rules" ],
    "ON" : { "node_insert--article" : { "bundle" : "article" } },
    "DO" : [
      { "mail_to_users_of_role" : {
          "roles" : { "value" : { "4" : "4" } },
          "subject" : "to new content come",
          "message" : "hello alll\r\nto kindly inform you new content is create.",
          "from" : [ "" ]
        }
      }
    ]
  }
}

Hope this helps you.

Thanks!