* @return void
*/
public function execute (Requestable $requestInstance, Responseable $responseInstance) {
- // Get a user instance from registry
- $userInstance = Registry::getRegistry()->getInstance('user');
+ // Get template instance
+ $templateInstance = $responseInstance->getTemplateInstance();
// Get a mailer class
- $mailerInstance = ObjectFactory::createObjectByConfiguredName('mailer_class');
+ $mailerInstance = ObjectFactory::createObjectByConfiguredName('mailer_class', array($templateInstance));
// Load the mail template
$mailerInstance->loadTemplate('resend_link');
+ // Get a user instance from registry
+ $userInstance = Registry::getRegistry()->getInstance('user');
+
// Add the recipient
- $mailerInstance->addRecipientByUser($userInstance);
+ $mailerInstance->addRecipientByUserInstance($userInstance);
// Set subject line from template
$mailerInstance->setSubjectFromTemplate();