Download & Extend

Allow multiple recipients in email actions

Project:Drupal core
Version:8.x-dev
Component:system.module
Category:feature request
Priority:normal
Assigned:Unassigned
Status:needs review

Issue Summary

It is not possible at the moment to send an email to multiple recipients without assigning multiple actions to a trigger. This patch allows a comma separated list of email addresses to be used, rather than forcing a single value. Patch is rolled against 5.x-2.5.

AttachmentSizeStatusTest resultOperations
actions_multiple_email_recipients.patch2.58 KBIdleFAILED: [[SimpleTest]]: [MySQL] Unable to apply patch actions_multiple_email_recipients.patch.View details | Re-test

Comments

#1

Is there a patch out that will allow this for drupal 6.x?

#2

Priority:minor» normal
Status:needs review» active

I'd also love to see this functionality! Has anyone worked out a solution for this in 6.x?

#3

Project:Actions» Drupal core
Version:5.x-2.5» 7.x-dev
Component:Code» system.module
Status:active» needs review

I would also like this feature, so let's commit a new patch. The patch doesn't consider the default language of more than one user. Should we always send in the default site language for more than one user?
Or split the mail recipients and send mails separately? This can be a problem with the load...

AttachmentSizeStatusTest resultOperations
284036-3.patch4.69 KBIdleFAILED: [[SimpleTest]]: [MySQL] 31,458 pass(es), 51 fail(s), and 0 exception(es).View details | Re-test

#4

A D6 backport you can find here #572190: Allow multiple recipients in email actions.

#5

Status:needs review» needs work

The last submitted patch, 284036-3.patch, failed testing.

#6

+++ modules/system/system.module 21 Jan 2011 18:39:21 -0000
@@ -3158,12 +3160,12 @@ function system_send_email_action($entit
-  $recipient_account = user_load_by_mail($recipient);
+  $recipient_account = user_load_by_mail($recipients);

This seems problematic -- I think you'd have to do a foreach ($recipients as $recipient) or similar here.

Powered by Dreditor.

#7

Status:needs work» needs review

Thanks bfroehle, but the problem is a false positive test, because I renamed the variable "recipient" to the plural "recipients". I don't know if this is allowed, but i have now adapt the test against my patch, so it can proof the recipients vars correctly.
But the point you suggested is still open. I don't know if it is useful to load the language for every recipient and send mails separately.

AttachmentSizeStatusTest resultOperations
284036-7.patch5.41 KBIdlePASSED: [[SimpleTest]]: [MySQL] 31,500 pass(es).View details | Re-test

#8

Status:needs review» needs work

Comment in #6 still stands..

Also... I think at this point it's too late to rename 'recipient' to 'recipients' in any way, as some contributed modules might be using it...

But overloading 'recipient' to allow multiple emails might be okay.

#9

Version:7.x-dev» 8.x-dev

Okay so under the presumption that users would not use the action function as mass mail service (performance problem), I patch this with a foreach for individual user language support.

And there are two versions now:
D8) For code consistence and coding standard we rename the var "recipient" into the plural in the next major release of Drupal.
D7) For compatibility to contributed modules we hold the var name "recipient" in all other versions.

AttachmentSizeStatusTest resultOperations
D8-284036-9.patch5.83 KBIdlePASSED: [[SimpleTest]]: [MySQL] 31,542 pass(es).View details | Re-test
D7-284036-9.patch4.24 KBIdlePASSED: [[SimpleTest]]: [MySQL] 31,543 pass(es).View details | Re-test

#10

Status:needs work» needs review

Set it to need review for automatic testing...

#11

Version:8.x-dev» 7.x-dev

D8 branches seems to be ignored for testing, so let's take it back to D7 first. :(

#12

subscribe

#13

Version:7.x-dev» 8.x-dev

Moving this to D8 list...

nobody click here