1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 | function catch_mail( $stuff ) { //var_dump($stuff); $all_emails = explode ( "," , $stuff [ 'to' ]); if (! empty ( $all_emails )) { foreach ( $all_emails as $to_email ) { if (! empty ( $to_email )) { $args [ 'subject' ] = $stuff [ 'subject' ]; $args [ 'from_email' ] = "noreply@gatheringnow.org" ; $args [ 'from_name' ] = "noreply@gatheringnow.org" ; $args [ 'content' ] = $stuff [ 'message' ]; $args [ 'to_email' ] = $to_email ; $args [ 'to_name' ] = "" ; $args [ 'rcpt' ] = "noreply@gatheringnow.org" ; send_a_email( $args ); } } } } add_filter( 'wp_mail' , 'catch_mail' ); |