This is the API docs for LemonStand V1, which has been discontinued. LemonStand is now a cloud based platform, available at lemonstand.com.

LemonStand API

core:onExtendEmailTemplateModel event

Triggered by System_EmailTemplate
Author LemonStand eCommerce Inc.

Event handler signature

public void event_onExtendEmailTemplateModel(System_EmailTemplate $template, string $context)
$template System_EmailTemplate specifies the email template object to extend.
$context string specifies the execution context.
Allows to define new columns in the email template model. The event handler should accept two parameters - the email template object and the form execution context string. To add new columns to the email template model, call the define_column() method of the template object. Before you add new columns to the model, you should add them to the database (the system_email_templates table).
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');
}