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:onBeforeEmailSendToCustomer event

Triggered by System_EmailTemplate
Author LemonStand eCommerce Inc.

Event handler signature

public array event_onBeforeEmailSendToCustomer(Shop_Customer $customer, string $subject, string $text, string $customer_email, string $customer_name, mixed $custom_data, array $reply_to, System_EmailTemplate $template)
$customer Shop_Customer customer object
$subject string specifies the message subject
$text string specifies the message text
$customer_email string specifies the customer email address. In some cases customer email address and name can be different from the email and name specified in the $customer object.
$customer_name string specifies the customer name.
$custom_data mixed extra parameters passed to the email template.
$reply_to array an array containing the reply-to email and name: array('john@example.com'=>'John Smith')
$template System_EmailTemplate specifies the email template
{return} array returns an array of overridden variables.
Triggered before an email notification is sent to a customer. The event handler can override some variables before the message is sent. The handler function should return an associative array containing variable names and values. The supported variables are:
  • subject
  • message_text
  • customer_email
  • customer_name
  • reply_to
  • settings_obj
Example:
public function subscribeEvents()
{
  Backend::$events->addEvent('core:onBeforeEmailSendToCustomer', $this, 'before_email_send_to_customer');
}

public function before_email_send_to_customer($customer, $subject, $message_text, $customer_email, $customer_name, $custom_data, $reply_to)
{
  $result = array(
    'reply_to'=>array('john@example.com'=>'John Smith')
  );

  return $result;
}