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

Triggered by System_EmailTemplate
Author LemonStand eCommerce Inc.

Event handler signature

public array event_onBeforeEmailSendToTeam(mixed $users, string $subject, string $text, string $customer_email, string $customer_name, array $reply_to, System_EmailTemplate $template)
$users mixed specifies a list of users to send the message to. The value can be either a data collection or array.
$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.
$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. The supported variables are: subject, message_text, customer_email, customer_name, reply_to, settings_obj
Triggered before an email notification is sent to LemonStand users. 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:onBeforeEmailSendToTeam', $this, 'before_email_send_to_team');
}

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

  return $result;
}