[英]Add second email address to variable php
I am using a plugin (Easy Digital Downloads) that sends an email for pending purchases, I need to add a second static email address into this email either as direct or cc. 我正在使用一个插件(Easy Digital Downloads)来发送一封电子邮件,等待购买,我需要在该电子邮件中添加第二个静态电子邮件地址,直接或抄送。 How can I do this?
我怎样才能做到这一点? This is the current code...
这是当前代码...
function eddcg_send_payment_instructions_email( $payment_id = 0 ) {
$email_body = edd_get_option( 'eddcg_pending_email' );
if ( empty ( $email_body ) ) {
return;
}
$email_body = edd_do_email_tags( $email_body, $payment_id );
$subject = edd_do_email_tags( edd_get_option( 'eddcg_pending_email_subject' , __( 'Your purchase is pending payment', 'eddcg' ) ), $payment_id );
$user_info = edd_get_payment_meta_user_info( $payment_id );
EDD()->emails->heading = edd_do_email_tags( edd_get_option( 'eddcg_pending_email_heading', false ), $payment_id );
EDD()->emails->send( $user_info['email'], $subject, $email_body );
} }
EDD_Emails::send uses wp_mail . EDD_Emails :: send使用wp_mail 。
Codex says: 食典说:
$to
$ to
(string or array) (required)
(字符串或数组)(必需)
The intended recipient(s).
预期的收件人。 Multiple recipients may be specified using an array or a comma-separated string.
可以使用数组或逗号分隔的字符串指定多个收件人。
So, these will work 因此,这些将起作用
EDD()->emails->send( array( $user_info['email'], $second_user_info['email'] ), $subject, $email_body );
or 要么
EDD()->emails->send( $user_info['email'].','.$second_user_info['email'], $subject, $email_body );
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.