Please see http://drupal.org/node/156415

Thank you

CommentFileSizeAuthor
#2 email_to_roles.php_.txt5.26 KBdayre

Comments

fuzzy_texan’s picture

Would be good if it was possible to send to one or more role's too.

dayre’s picture

Category: support » feature
Status: Active » Needs review
StatusFileSize
new5.26 KB

I needed this too and wrote an action function to send e-mails to one or more roles, you can also restrict it to certain node types. I think it would be a great idea if this attached function/patch could be added to the default actions.inc set.

HowyP’s picture

dayre, thanks for this snippet. It's a big help, just what I was looking for. I couldnt't get the action to work initially, I had to change the line
if (0 && drupal_mail('action_send_role_email', $recipient, $subject, $message, $from)) {
to
if (drupal_mail('action_send_role_email', $recipient, $subject, $message, $from)) {

Was there a reason for the 0 &&?

darumaki’s picture

Category: feature » support
Status: Needs review » Active

where/how do we save this action function ?

is this correct ?

name action_send_email anything added to it ? does it get saved as a module ? action_send_email.module ?

jvandyk’s picture

For actions for Drupal 5, the action can be anywhere. You could put it in your own module if you wanted. The name does need to be unique, though, so action_send_email_to_role would be a nice name for it.

prunelle’s picture

I introduced the supplied code in the actions.inc file (under the function name: action_send_email_to_role. I've used it with the workflow module. It's working fine. But when the function is executed during the state change, I got the message, in the watchdog", that says "Unable to send ...." for each of the recipient.
What could make the call to "drupal_mail" fail ?

Does it actually work on Drupal 5 ?

Thanks for your answer.

Best regards.

optalgin’s picture

Can someone help to convert this to drupal 6.x
Thanks

v1nce’s picture

I updated the actions_email_role module to be compatible with Workflow and Actions versions 5.x-2.x.

http://drupal.org/node/244508

pomliane’s picture

Status: Active » Closed (won't fix)

This version of Actions is not supported anymore. The issue is closed for this reason.
Please upgrade to a supported version and feel free to reopen the issue on the new version if applicable.

This issue has been automagically closed by a script.