Creating automatic email/sms message

Template

Set content and execute the send action

Define message

Email message can be defined creating a Mail action.

In preferences you can define sender, receiver and message.

You can also attach message to page change -event, when it is sent automaticly when page is modified.

Use predefined message in code

Activate message in code

Add code to send email when order is chaged to ordered:

if ( $Order->status->isChangedTo('Ordered') ){
  $Order->getAction('mail_confirm_order')->send();
  $this->get('feedback','Order confirmation sent to client');
}

Get Mail object to modify message before sending:

$Mail = $Order->getAction('mail_confirm_order')->getMail();
$Mail->addBcc('notify@me.com');
$Mail->addBody('This is added to the message body');
$Mail->send();

Get Sms object to modify message before sending:

$Sms = $Order->getAction('sms_confirm_order')->getMail();
$Sms->addMessage('This is added to the message body');
$Sms->send();

Manually sending a message

If message is set to be visible in page menu, enduser can activate sending it in Page edit view or Table Pages -list.