Documentation

Mail
in package

OBSOLETE -- See {@see core/MailTemplate.class.php}

Tags
copyright

CLOUDREXX CMS - CLOUDREXX AG

author

CLOUDREXX Development Team info@cloudrexx.com

subpackage

module_shop

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
throws
Update_DatabaseException
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
static
global

ADONewConnection

author

Reto Kohli reto.kohli@comvation.com

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
todo

Some valid addresses are rejected by this method, such as %+@mymail.com. Valid (atom) characters are: "!#$%&'+-/=?^_`{|}~" (without the double quotes), see RFC 2822 for details.

todo

The rules applied to host names are not correct either, see RFC 1738 and . Excerpt from RFC 1738:

  • hostport = host [ ":" port ]
  • host = hostname | hostnumber
  • hostname = *[ domainlabel "." ] toplabel
  • domainlabel = alphadigit | alphadigit *[ alphadigit | "-" ] alphadigit
  • toplabel = alpha | alpha *[ alphadigit | "-" ] alphadigit
  • alphadigit = alpha | digit Excerpt from RFC 3986: "Non-ASCII characters must first be encoded according to UTF-8 [STD63], and then each octet of the corresponding UTF-8 sequence must be percent- encoded to be represented as URI characters".
todo

This doesn't really belong here. Should be placed into a proper core e-mail class as a static method.

Return values
bool

reset()

Reset the class

public static reset() : mixed

Forces an the next time content is accessed

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
static
author

Reto Kohli reto.kohli@comvation.com

Return values
bool

True if the mail could be sent, false otherwise

storeTemplate()

Update or add new template

public storeTemplate() : mixed

        
On this page

Search results