Noptin_Mailer::prepare( $data = array() )

Prepares an email for sending.


Source Source

File: includes/class-noptin-mailer.php

	public function prepare( $data = array() ) {

		// Ensure that we have merge tags.
		if ( empty( $data['merge_tags'] ) ) {
			$data['merge_tags'] = array();
		}

		// Ensure that a few variables are set.
		$data['email_subject']   = $this->get_subject( $data );
		$data['title']           = $data['email_subject'];
		$data['logo_url']        = $this->get_logo_url( $data );
		$data['tracker']         = $this->get_tracker( $data );
		$data['permission_text'] = ! isset( $data['permission_text'] ) ? $this->get_permission_text( $data ) : $data['permission_text'];
		$data['permission_text'] = wpautop( $data['permission_text'] );
		$data['footer_text']     = ! isset( $data['footer_text'] ) ? $this->get_footer_text( $data ) : $data['footer_text'];
		$data['footer_text']     = wpautop( $data['footer_text'] );
		$data['hero_text']       = empty( $data['hero_text'] ) ? '' : $data['hero_text'];
		$data['cta_url']         = empty( $data['cta_url'] ) ? '' : $data['cta_url'];
		$data['cta_text']        = empty( $data['cta_text'] ) ? '' : $data['cta_text'];
		$data['after_cta_text']  = empty( $data['after_cta_text'] ) ? '' : $data['after_cta_text'];
		$data['after_cta_text2'] = empty( $data['after_cta_text2'] ) ? '' : $data['after_cta_text2'];
		$data['email_body']      = $this->build_email( $data );
		$this->mailer_data       = $data;

		return $data;
	}


Top ↑

User Contributed Notes User Contributed Notes

30 day money back guarantee
Safe & Secure online payment
Custom CSS Slide Example
Custom Animation Example
Default Animation