docs
docs copied to clipboard
Separating mailing logic by adding implementedEvents does not work as described.
In the documentation it is shown as:
public function implementedEvents()
{
return [
'Model.afterSave' => 'onRegistration'
];
}
public function onRegistration(Event $event, EntityInterface $entity, ArrayObject $options)
{
if ($entity->isNew()) {
$this->send('welcome', [$entity]);
}
}
Mailer class never runs in this way. Sorry, I don't know how should this be.