Skip to:
Content

BuddyPress.org

Opened 7 days ago

Last modified 6 days ago

#8159 assigned defect (bug)

bp_send_email not sending emails to all if passing multiple email ids since 4.0.0 update

Reported by: alexhal Owned by: DJPaul
Milestone: Awaiting Review Priority: high
Severity: major Version: 2.5.0
Component: Emails Keywords: reporter-feedback
Cc:

Description

Hi we are using bp_send_email to send email to single and multiple users.
We are sending array of email :

`
$emails = [
'abc@…',
'efg@…',
'hij@…'
]
$email_type = 'custom';
$bpargs = array(
'tokens' => array('post.name'=>'customtoken')
);
bp_send_email( $email_type,$emails, $bpargs );`

So after execution it is only sending email to first email in array : abc@…

It use to send email to all emails in that array previously .

however running a loop and sending email to one user at a time is working :

`
$emails = [
'abc@…',
'efg@…',
'hij@…'
]
$email_type = 'custom';
$bpargs = array(
'tokens' => array('post.name'=>'customtoken')
);
foreach($emails as $email){
bp_send_email( $email_type,$email, $bpargs );
}
`

Please tell us what exactly is wrong with this ?
Does bp_send_email function does not supports sending email to multiple email in one go.We really want to avoid the for loop .

Change History (2)

#1 @imath
6 days ago

  • Version changed from 5.0.0 to 2.5.0

Hi @alexhal

Thanks for your feedback. I'm going to look at it.

I just wanted to make sure you tested it without any plugins active as after checking our unit tests suite: sending multiple emails at once hasn't failed so far (FYI if there was a problem: it should).

#2 @imath
6 days ago

  • Keywords reporter-feedback added

I've just tested, when I'm using 2 users, the "To" email field is containing the emails of these two users separated with a comma, so I guess they both receive the email. Here's what I get testing with mailhog:

https://cldup.com/N5CZLpkcH9.png

So to me, it's behaving the right way.

Note: See TracTickets for help on using tickets.