LimeMailer

Extends\PHPMailer\PHPMailer\PHPMailer

WIP A SubClass of phpMailer adapted for LimeSurvey

package

Default

Methods

__construct

__construct( $exceptions = false)
inheritdoc

Default exception to false (we use getError or getDebug) WIP Set all needed fixed in params

Arguments

$exceptions

addAddress

addAddress( $addressTo, $name = '')
inheritdoc

Fix first parameters if he had email + name ( Name format)

Arguments

$addressTo

$name

Set the attachments according to current survey,language and emailtype @ return void

addAttachementsByType()

Add a debug line (with a new line like SMTP echo)

addDebug( $str, $level): void

Arguments

$str

$level

Add url place holder

addUrlsPlaceholders(string|array<mixed,string> $aUrlsPlaceholders): void

Arguments

$aUrlsPlaceholders

string|array<mixed,string>

an array of url placeholder to set automatically

attachementExists

attachementExists( $aAttachment)

Arguments

$aAttachment

clearAttachments

clearAttachments()
inheritdoc

Reset the attachementType done to false

Do the replacements : if current replacement jey is set and LimeSurvey core have it too : it reset to the needed one.

doReplacements(string $string): string

Arguments

$string

string

wher need to replace

Response

string

Hate to use global var maybe add format : raw (array of errors), html : clean html etc …

getDebug(string $format = ''): null|string|array

Arguments

$format

string

(currently only html or null (return array))

Response

null|string|array

Get the the most recent mailer error message.

getError(): null|string
see \parent::ErrorInfo

Response

null|string

Return the event message

getEventMessage(): string

Response

string

Get from

getFrom(): string

Response

string

from (name )

To get a singleton : some part are not needed to do X times

getInstance(integer $reset = self::ResetBase)
static

Arguments

$reset

integer

totally or partially the instance return \LimeMailer

Find if current email is in HTML

getIsHtml(): boolean

Response

boolean

Get the replacements for token.

getTokenReplacements(): array<mixed,string>

Response

array<mixed,string>

Set the minimal default for LimeSurvey

init()

Launch the needed event : beforeTokenEmail, beforeSurveyEmail, beforeEmail and update this according to action

manageEvent( $eventParams = array())
var

specific event parameters to add return boolean|null : sended of not, if null : no action are done by event, can use default action.

Arguments

$eventParams

Send

Send()
inheritdoc

Disable all sending in demoMode

Construct and do what must be done before sending a message

sendMessage(): boolean

Response

boolean

setFrom

setFrom( $from, $fromname = null, $auto = true): boolean
inheritdoc

Fix first parameters if he had email + name ( Name format)

Arguments

$from

$fromname

$auto

Response

boolean

Set email for this survey If surveyId are not updated : no reset of from or sender

setSurvey(integer $surveyId): void

Arguments

$surveyId

integer

Set the to

setTo( $addressTo, $name = ''): void
see self::addAddress

Arguments

$addressTo

$name

Set token for this survey

setToken(string $token): void
Throws
\CException

Arguments

$token

string

set the rawSubject and rawBody according to type See if must throw error without

setTypeWithRaw(string|null $emailType,string|null $language = null)

Arguments

$emailType

string|null

: set the rawSubject and rawBody at same time

$language

string|null

forced language

validateAddress

validateAddress( $address, $patternselect = null)
static
inheritdoc

Adding php with idna support Must review , seems phpMailer have something with idn ? @see parent::idnSupported

Arguments

$address

$patternselect

Validate an list of email addresses - either as array or as semicolon-limited text

validateAddresses(string $aEmailAddressList,string|callable $patternselect = null): string
static
returns

array

Arguments

$aEmailAddressList

string

Email address to check

$patternselect

string|callable

Which pattern to use (default to static::$validator)

Response

string

List with valid email addresses - invalid email addresses are filtered - false if none of the email addresses are valid

Constants

ResetNone

ResetNone

ResetBase

ResetBase

ResetComplete

ResetComplete

Properties

Singleton

instance :\LimeMailer
static
var

Type(s)

\LimeMailer

surveyId

surveyId :

Type(s)

mailLanguage

mailLanguage :

Type(s)

html

html :

Type(s)

oToken

oToken :

Type(s)

aUrlsPlaceholders

aUrlsPlaceholders :

Type(s)

aReplacements

aReplacements :

Type(s)

Current email type, used for updating email raw subject and body for token (in survey) : invite, remind, confirm, register … for survey (admin or not) : admin_notification, admin_responses, savesurveydetails, errorsavingresults other : addadminuser, passwordreminderadminuser, mailsendusergroup …

emailType :string
var

Current email type, used for updating email raw subject and body for token (in survey) : invite, remind, confirm, register … for survey (admin or not) : admin_notification, admin_responses, savesurveydetails, errorsavingresults other : addadminuser, passwordreminderadminuser, mailsendusergroup …

Type(s)

string

Attachements by type : using different key for all this part …

_aAttachementByType :array<mixed,string>
var

Type(s)

array<mixed,string>

replace token attributes (FIRSTNAME etc …) and replace to TOKEN:XXX by XXXX

replaceTokenAttributes :boolean
var

replace token attributes (FIRSTNAME etc …) and replace to TOKEN:XXX by XXXX

Type(s)

boolean

Current attachements (as string or array)

aAttachements :array
var

Current attachements (as string or array)

see

Type(s)

array

Current attachements (as string or array)

_bAttachementTypeDone :boolean
var

Current attachements (as string or array)

Type(s)

boolean

The Raw Subject of the message. before any Expression Replacements and other update

rawSubject :string
var

$rawBody

Type(s)

string

The Rw Body of the message, before any Expression Replacements and other update

rawBody :string
var

Type(s)

string

Charset of Body and Subject

BodySubjectCharset :string
var

Charset of Body and Subject

see

@CharSet

Type(s)

string

CharSet

CharSet :
inheritdoc

, defaultto utf-8

Type(s)

eventName

eventName :

Type(s)

eventMessage

eventMessage :

Type(s)

debug

debug :

Type(s)

validator

validator :string|callable
static
inheritdoc

Set default to idna (unsure is needed : need an idna email to check since seems PHPMailer do the job here ?)

var

Type(s)

string|callable