Skip to:
Content
Pages
Categories
Search
Top
Bottom

bp_send_email not sending email for multiple email ids since 4.0.0 update


  • alexhal
    Participant

    @alexhal

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

     
    $emails = [
    'abc@g.com',
    'efg@g.com',
    'hij@g.com'
    ]
    $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@g.com

    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@g.com',
    'efg@g.com',
    'hij@g.com'
    ]
    $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 .

Viewing 1 replies (of 1 total)
  • Hi!

    For your information and as a follow up of the ticket you opened on Trac ( https://buddypress.trac.wordpress.org/ticket/8159 ), I’ve checked on my side and wasn’t able to reproduce.

    My config is WordPress 5.2.4, BuddyPress 5.1.0-beta1, Twenty Nineteen as the active thme. No other plugins or specific custom code in /wp-content/mu-plugins or /wp-content/plugins/bp-custom.php.

Viewing 1 replies (of 1 total)
  • You must be logged in to reply to this topic.
Skip to toolbar