CoolCMS API

EmailFormTrait

Add/edit form of an email template.

The skeleton comes from BasePresenter::createForm(), the multilingual fields and conversions from AdminFormHelpersTrait.

Translated attributes: title, subject, body (TinyMCE editor). Untranslated: key (unique template key), preferred, sendImmediately, active (global activation, the header toggle).

TODO: attachments (files, legacy serialized uploader) are not converted yet.

Table of Contents

Methods

createComponentEditForm()  : Form
addSettingsFields()  : void
Untranslated settings: template key, preferred channel, global activation.
addTranslationFields()  : void
Per-language fields: title, subject and body (editor), required only when the language is active.
buildEmailEntity()  : Email
saveEmailForm()  : bool
Saves the form data; the redirect is handled by {@see \App\Core\Base\Admin\BasePresenter::createForm()}.
setEmailFormDefaults()  : void

Methods

addSettingsFields()

Untranslated settings: template key, preferred channel, global activation.

private addSettingsFields(Form $form) : void
Parameters
$form : Form

addTranslationFields()

Per-language fields: title, subject and body (editor), required only when the language is active.

private addTranslationFields(Form $form) : void
Parameters
$form : Form

buildEmailEntity()

private buildEmailEntity(ArrayHash<string|int, mixed> $values) : Email
Parameters
$values : ArrayHash<string|int, mixed>
Return values
Email

saveEmailForm()

Saves the form data; the redirect is handled by {@see \App\Core\Base\Admin\BasePresenter::createForm()}.

private saveEmailForm(ArrayHash<string|int, mixed> $values) : bool
Parameters
$values : ArrayHash<string|int, mixed>
Return values
bool
On this page

Search results