Helper::send_emails()

Description #

Send emails.

Source #

File: addons/email/class-helper.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' );
		}

		if ( ! empty( $this->emails ) ) {
			foreach ( $this->emails as $email ) {
				wp_mail( $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