Email_Notifications::wrap_message( string $message, string $title = '' )

Wraps the message in valid presentational HTML markup.

Description

Parameters

$message

(string) (Required) HTML message to wrap.

$title

(string) (Optional) String to use in the title tag. Default empty string for no title.

Default value: ''

Return

(string) Wrapped HTML message.

Source

File: src/modules/actions/email-notifications.php

	protected function wrap_message( $message, $title = '' ) {
		$before  = '<!DOCTYPE html>';
		$before .= '<html>';
		$before .= '<head>';
		$before .= '<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />';
		if ( ! empty( $title ) ) {
			$before .= '<title>' . esc_html( $title ) . '</title>';
		}
		$before .= '</head>';
		$before .= '<body>';

		$after  = '</body>';
		$after .= '</html>';

		return $before . $message . $after;
	}

Changelog

Changelog
Version Description
1.0.0 Introduced.