]> git.mxchange.org Git - shipsimu.git/blobdiff - inc/classes/main/commands/web/class_WebResendLinkCommand.php
Login area extended and misc things changed:
[shipsimu.git] / inc / classes / main / commands / web / class_WebResendLinkCommand.php
index 5decea579069410061847a723f64cd1cb0fae17d..c08066adc45a5e36c1ef9fe8a23162b9b6c94289 100644 (file)
@@ -66,17 +66,20 @@ class WebResendLinkCommand extends BaseCommand implements Commandable {
         * @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();