class MailParser

This class parses Mail templates.

Returns the structured file information.

Constants

SECTION_SEPARATOR

Methods

static array
parse(string $content)

Parses Mail template content.

Details

at line 31
static array parse(string $content)

Parses Mail template content.

The expected file format is following:

Settings section
==
Plain-text content section
==
HTML content section

If the content has only 2 sections they are considered as settings and HTML. If there is only a single section, it is considered as HTML.

Parameters

string $content

Specifies the file content.

Return Value

array

Returns an array with the following indexes: 'settings', 'html', 'text'. The 'html' and 'text' elements contain strings. The 'settings' element contains the parsed INI file as array. If the content string doesn't contain a section, the corresponding result element has null value.