Noptin_Mailer::post_process( $content,  $data )

Post processes an email message.


Source Source

File: includes/class-noptin-mailer.php

	public function post_process( $content, $data ) {

		// Parse merge tags.
		$content = $this->merge( $content, $data['merge_tags'] );

		// Make links clickable.
		$content = make_clickable( $content );

		// Ensure that shortcodes are not wrapped in paragraphs.
		$content = shortcode_unautop( $content );

		// Execute shortcodes.
		$content = do_shortcode( $content );

		// Balance tags.
		$content = force_balance_tags( $content );

		// Make links trackable.
		$content = $this->make_links_trackable( $content, $data );

		if ( 'empty' === $data['template'] ) {
			return $content;
		}

		// Finally, inline the CSS.
		$content = $this->inline_css( $content );

		// inline css adds a body tag, which doesn't play nice if we are using a template plugin.
		if ( ! $this->disable_template_plugins ) {
			$matches = array();
			preg_match( "/<body[^>]*>(.*?)<\/body>/is", $content, $matches );

			if ( isset( $matches[1] ) ) {
				$content = trim( $matches[1] );
			}

		}

		// Filters a post processed email.
		return apply_filters( 'noptin_post_processed_mailer_email_content', $content, $data, $this );
	}


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