Email::send_emails()
Description #
Send emails.
Source #
File: addons/free/email/class-email.php
public function send_emails() {
if ( defined( 'AP_DISABLE_EMAIL' ) && true === AP_DISABLE_EMAIL ) {
return;
}
$body = $this->prepare_template();
$this->prepare_emails();
if ( empty( $this->emails ) ) {
return new WP_Error( 'no_emails' );
}
$first_email = $this->emails[0];
unset( $this->emails[0] );
if ( ! empty( $this->emails ) ) {
foreach ( $this->emails as $email ) {
$this->email_headers[] = "Bcc: $email";
}
}
return wp_mail( $first_email, $this->subject, $body, $this->email_headers );
}
Expand full source code Collapse full source code View on GitHub: addons/free/email/class-email.php:309
Add your comment