MailParser
in package
This class parses Mail templates.
Returns the structured file information.
Tags
Table of Contents
- SECTION_SEPARATOR = '=='
- parse() : array<string|int, mixed>
- Parses Mail template content.
Constants
SECTION_SEPARATOR
public
mixed
SECTION_SEPARATOR
= '=='
Methods
parse()
Parses Mail template content.
public
static parse(string $content) : array<string|int, mixed>
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
- $content : string
-
Specifies the file content.
Return values
array<string|int, mixed> —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.