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 );
	}

Leave a Reply

Your email address will not be published.

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Add your comment