]> 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 887712e75f078900c01dde9d9d40cc04ae86746d..c08066adc45a5e36c1ef9fe8a23162b9b6c94289 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@ship-simu.org>
  * @version            0.0.0
- * @copyright  Copyright(c) 2007, 2008 Roland Haeder, this is free software
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, this is free software
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.ship-simu.org
  *
@@ -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");
+               $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();