package Gems
subpackage Mail
copyright Copyright (c) 2013 Erasmus MC
license New BSD License
since Class available since version 1.6.2

 Methods

Add Flash Message

addMessage(string $message) 

Parameters

$message

string

Add a To field

addTo($newTo, $newToName = '') 

Parameters

$newTo

$newToName

After registry load, load the MailFields

afterRegistry() 

Replace the mailkeys with the mailfields in given text

applyFields(string $text) : string

Parameters

$text

string

The text to apply the replacment to

Returns

stringThe text with replaced mailfields

Returns true if the "email.bounce" setting exists in the project configuration and is true

bounceCheck() : boolean

Returns

boolean

Get the prefered template language

getLanguage() : string

Returns

stringlanguage code

Return the mailFields

getMailFields(boolean $marked = true) : Array

Parameters

$marked

boolean

Return the mailfields with their markers

Returns

ArrayList of the mailfields and their values

Get Flash message

getMessages() : Array

Returns

Array

Get the organization in relation to the current mailtarget

getOrganization() : \Gems_User_Organization

Returns

\Gems_User_Organization

Get specific data set in the mailer

getPresetTargetData() : Array

Returns

Array

get a specific template.

getTemplate(integer $templateId, $language = null) 

If the selected translation exists, get that translation Else if the selected translation isn't the default, select the default translation Else select the first not empty translation Else return false

Parameters

$templateId

integer

Template ID

$language

Add specified markers to the mailfield keys

markMailFields($mailFields) : Array

Parameters

$mailFields

Returns

ArrayThe marked mailfields

Send the mail

send() 

setBody()

setBody($message, $renderer = 'Bbcode') 

Parameters

$message

$renderer

set the from field

setFrom($newFrom) 

Parameters

$newFrom

Set the languange in which the mail should be sent.

setLanguage(string $language) 

Parameters

$language

string

language code

Set the current Organization as from

setOrganizationFrom() 

Organization or project Style (as defined in application/configs/email/)

setStyle($style) 

Parameters

$style

set the subject of the mail

setSubject($newSubject) 

Parameters

$newSubject

set a specific template as subject/body

setTemplate(integer $templateId) 

Parameters

$templateId

integer

Template ID

set the base selected template. The actual message could be changed

setTemplateId(integer $templateId) 

Parameters

$templateId

integer

Template ID

Set the time when the email should be sent.

setTime() 

set the To field, overwriting earlier settings completely

setTo($newTo, $newToName = '') 

Parameters

$newTo

$newToName

Add Mailfields to the existing mailfields

addMailFields(array $mailfields) 

Parameters

$mailfields

array

After the mail has been processed by the mailer

afterMail() 

Before the mail is processed by the mailer

beforeMail() 

Get the correct Mail Template Style

getTemplateStyle() : string

Returns

string

Initialize the mailfields

loadMailFields() 

Load the organization from the given organization id

loadOrganization() 

Function to get the current organization id.

loadOrganizationId() 

 Properties

 

Message body in BBcode

$bodyBb : string

Default

 

Message body in Html

$bodyHtml : string

Default

 

Message body in Plain Text

$bodyText : string

Default

 

$db

$db 

Default

 

Email From field

$from : string

Default

 

$language

$language 

Default

 

$layout

$layout 

Default

 

$loader

$loader : \Gems_Loader

Default

 

The start and end markers for the mailfields

$mailFieldMarkers : array

Default

array('start' => '{', 'end' => '}')
 

Collection of the different available mailfields

$mailFields : array

Default

 

The mailfields with marked keys

$markedMailFields : array

Default

 

Flash messages

$messages : array

Default

 

$organization

$organization : \Gems_User_Organization

Default

 

Organization ID

$organizationId : integer

Default

 

Project Object

$project : 

Default

 

Subject of the Message

$subject : string

Default

 

filename of the html template

$templateStyle : string

Default

 

$time

$time 

Default

 

Collection of all the recipients of the mail

$to : array

Default

array()
 

$util

$util 

Default