Craft Emails (2.x)

MessagesService extends Component
in package

Table of Contents

addTranslation()  : bool
Add a translation
deleteTranslation()  : bool
Delete a translation
getAllSystemMessages()  : array<string|int, mixed>
Replaces system messages with emails
getMessage()  : SystemMessage|null
Get the system message associated to an email key, for a language.
saveMessage()  : bool
Save a system message
updatePrimaryMessageLanguage()  : mixed
Change language of messages that are set on default languages.

Methods

addTranslation()

Add a translation

public addTranslation(string $key, string $langId) : bool
Parameters
$key : string
$langId : string
Return values
bool

deleteTranslation()

Delete a translation

public deleteTranslation(string $key, string $langId) : bool
Parameters
$key : string
$langId : string
Return values
bool

getAllSystemMessages()

Replaces system messages with emails

public getAllSystemMessages(array<string|int, mixed> $messages) : array<string|int, mixed>
Parameters
$messages : array<string|int, mixed>
Return values
array<string|int, mixed>

getMessage()

Get the system message associated to an email key, for a language.

public getMessage(string $key[, string|null $langId = null ]) : SystemMessage|null

Defaults to primary site language

Parameters
$key : string
$langId : string|null = null
Return values
SystemMessage|null

saveMessage()

Save a system message

public saveMessage(SystemMessage $message, string $langId[, array<string|int, mixed> $attachements = [] ]) : bool
Parameters
$message : SystemMessage
$langId : string
$attachements : array<string|int, mixed> = []

array of ids

Return values
bool

updatePrimaryMessageLanguage()

Change language of messages that are set on default languages.

public updatePrimaryMessageLanguage(string $oldLanguage, string $newLanguage) : mixed

If some messages were set on the new language they will be deleted

Parameters
$oldLanguage : string
$newLanguage : string
Return values
mixed

Search results