Allows to add new fields to the Create/Edit Email Template form.
Usually this event is used together with the
core:onExtendEmailTemplateModel event.
The event handler should accept two parameters - the email template object and the form execution context string.
To add new fields to the form, call the
add_form_field() method of
the template object.
public function subscribeEvents()
{
Backend::$events->addEvent('core:onExtendEmailTemplateModel', $this, 'extend_email_template_model');
Backend::$events->addEvent('core:onExtendEmailTemplateForm', $this, 'extend_email_template_form');
}
public function extend_email_template_model($template, $context)
{
$template->define_column('x_extra_description', 'Extra description');
}
public function extend_email_template_form($template, $context)
{
$template->add_form_field('x_extra_description')->tab('Description');
}