LemonStand Documentation

onDeleteEmailTemplate event

The onDeleteEmailTemplate event is triggered when a user tries to delete an email template in the Administration Area. The event handler should accept a single parameter - the email template object (System_EmailTemplate class instance). You can throw an exception in the handler code, if you do not want a specific email template to be deleted.

Event handler example:

public function subscribeEvents()
{
  Backend::$events->addEvent('onDeleteEmailTemplate', $this, 'process_template_deletion');
}
 
public function process_template_deletion($template)
{
  if ($template->code == 'payment_notificaiton')
      throw new Phpr_ApplicationException('You cannot delete this email template.');
}

Next: cms:onExtendPageModel event
Previous: core:onSendEmail event
Return to Handling LemonStand events