Mail
in package
OBSOLETE -- See {@see core/MailTemplate.class.php}
Tags
Table of Contents
Properties
- $arrTemplate : array<string|int, mixed>
- The array of mail templates
- $lang_id : int
- The language ID used when init() was called
Methods
- deleteTemplate() : mixed
- Delete template
- errorHandler() : bool
- Migrates existing old Shop mailtemplates to the new MailTemplate class
- getTemplate() : mixed
- Pick a mail template from the database
- getTemplateArray() : mixed
- init() : bool
- Initialize the mail template array
- isValidAddress() : bool
- Validate the email address
- reset() : mixed
- Reset the class
- send() : bool
- Set up and send an email from the shop.
- store() : mixed
- storeTemplate() : mixed
- Update or add new template
Properties
$arrTemplate
The array of mail templates
private
static array<string|int, mixed>
$arrTemplate
= false
$lang_id
The language ID used when init() was called
private
static int
$lang_id
= false
Methods
deleteTemplate()
Delete template
public
static deleteTemplate() : mixed
errorHandler()
Migrates existing old Shop mailtemplates to the new MailTemplate class
public
static errorHandler() : bool
Tags
Return values
bool —False. Always.
getTemplate()
Pick a mail template from the database
public
static getTemplate(int $template_id[, int $lang_id = 0 ]) : mixed
Get the selected mail template and associated fields from the database.
Parameters
- $template_id : int
-
The mail template ID
- $lang_id : int = 0
-
The language ID
Tags
Return values
mixed —The mail template array on success, false otherwise
getTemplateArray()
public
static getTemplateArray([mixed $lang_id = 0 ]) : mixed
Parameters
- $lang_id : mixed = 0
init()
Initialize the mail template array
public
static init([int $lang_id = 0 ]) : bool
Uses the given language ID, if any, or the language set in the LANG_ID global constant. Upon success, stores the language ID used in the $lang_id class variable.
Parameters
- $lang_id : int = 0
-
The optional language ID
Return values
bool —True on success, false otherwise
isValidAddress()
Validate the email address
public
isValidAddress(string $string) : bool
Does an extensive syntax check to determine whether the string argument is a real email address. Note that this doesn't mean that the address is necessarily valid, but only that it isn't just an arbitrary character sequence.
Parameters
- $string : string
Tags
Return values
boolreset()
Reset the class
public
static reset() : mixed
send()
Set up and send an email from the shop.
public
static send(string $mailTo, string $mailFrom, string $mailSender, string $mailSubject, string $mailBody) : bool
Parameters
- $mailTo : string
-
Recipient mail address
- $mailFrom : string
-
Sender mail address
- $mailSender : string
-
Sender name
- $mailSubject : string
-
Message subject
- $mailBody : string
-
Message body
Tags
Return values
bool —True if the mail could be sent, false otherwise
store()
public
static store() : mixed
storeTemplate()
Update or add new template
public
storeTemplate() : mixed