CRM_Utils_Mail_FilteredPearMailer
extends Mail
in package
The filtered-mailer is a utility to wrap an existing PEAR Mail class and apply extra filters. It is primarily intended for resolving quirks in the standard implementations.
This wrapper acts a bit like a chameleon, passing-through properties
from the underlying object. Consequently, internal properties are
prefixed with _
to avoid conflict.
Tags
Table of Contents
Properties
- $_delegate : Mail
- $_driver : string
- $_filters : array<string|int, callable>
- $_params : array<string|int, mixed>
Methods
- __construct() : mixed
- CRM_Utils_Mail_FilteredPearMailer constructor.
- __destruct() : mixed
- __get() : mixed
- __isset() : mixed
- __set() : mixed
- __unset() : mixed
- addFilter() : static
- disconnect() : mixed
- getDriver() : string
- send() : mixed
Properties
$_delegate
protected
Mail
$_delegate
$_driver
protected
string
$_driver
Ex: 'smtp' or 'sendmail'
$_filters
protected
array<string|int, callable>
$_filters
= []
$_params
protected
array<string|int, mixed>
$_params
Methods
__construct()
CRM_Utils_Mail_FilteredPearMailer constructor.
public
__construct(string $driver, array<string|int, mixed> $params, Mail $mailer) : mixed
Parameters
- $driver : string
- $params : array<string|int, mixed>
- $mailer : Mail
__destruct()
public
__destruct() : mixed
__get()
public
& __get(mixed $name) : mixed
Parameters
- $name : mixed
__isset()
public
__isset(mixed $name) : mixed
Parameters
- $name : mixed
__set()
public
__set(mixed $name, mixed $value) : mixed
Parameters
- $name : mixed
- $value : mixed
__unset()
public
__unset(mixed $name) : mixed
Parameters
- $name : mixed
addFilter()
public
addFilter(string $id, callable $func) : static
Parameters
- $id : string
-
Unique ID for this filter. Filters are sorted by ID. Suggestion: '{nnnn}_{name}', where '{nnnn}' is a number. Filters are sorted and executed in order.
- $func : callable
-
function(FilteredPearMailer $mailer, mixed $recipients, array $headers, string $body). The return value should generally be null/void. However, if you wish to short-circuit execution of the filters, then return a concrete value.
Return values
staticdisconnect()
public
disconnect() : mixed
getDriver()
public
getDriver() : string
Return values
string —Ex: 'smtp', 'sendmail', 'mail'.
send()
public
send(mixed $recipients, mixed $headers, mixed $body) : mixed
Parameters
- $recipients : mixed
- $headers : mixed
- $body : mixed