$previews) : ?>
| Html->link($email, [ 'controller' => 'MailPreview', 'action' => 'email', '?' => ['plugin' => $plugin], $mailPreview->name(), $email, ]); ?> |
= __d('debug_kit', 'Testing emails can be very time consuming') ?> ⌛
= __d('debug_kit', 'Specially when you need to click a bunch of times on an interface to trigger them.') ?>
= __d('debug_kit', "Wouldn't it be better to just change the templates and refresh the browser to see the result?") ?>
= __d('debug_kit', 'Just the way you work on the web interface!') ?> 🏃
= __d('debug_kit', "{0} integrates with CakePHP’s {1} class. Here's an example of such a mailer:", 'MailPreview', 'Mailer') ?>
to($user->email)
->subject(sprintf("Welcome %s", $user->name))
->template("welcome_mail") // ' . __d('debug_kit', 'By default template with same name as method name is used.') . '
->layout("custom")
->set(["user" => $user]);
}
}';
highlight_string($code);
?>
= __d('debug_kit', 'Now you create a {0} class where you can pass some dummy values.', 'MailPreview') ?>
loadModel("Users");
$user = $this->Users->find()->first();
return $this->getMailer("User")
->welcome($user)
->set(["activationToken" => "dummy-token"]);
}
}';
highlight_string($code);
?>
= __d('debug_kit', 'Note that the function MUST return the UserMailer object at the end.') ?>
= __d('debug_kit', 'Since {0} have a fluent interface, you just need to return the result of the chain of calls.', 'Mailers') ?>
= __d('debug_kit', "That's it, now refresh this page!") ?> 🙃