diff --git a/module/VuFind/src/VuFind/Controller/AjaxController.php b/module/VuFind/src/VuFind/Controller/AjaxController.php index c72f6133c9844787de5cafb58d31384ea64f3394..f4ace4ae512a03b1927eace2dd529e7142935b11 100644 --- a/module/VuFind/src/VuFind/Controller/AjaxController.php +++ b/module/VuFind/src/VuFind/Controller/AjaxController.php @@ -1086,10 +1086,19 @@ class AjaxController extends AbstractBase // Attempt to send the email: try { $view = $this->createEmailViewModel(); - $this->getServiceLocator()->get('VuFind\Mailer')->sendLink( + $mailer = $this->getServiceLocator()->get('VuFind\Mailer'); + $mailer->sendLink( $view->to, $view->from, $view->message, $url, $this->getViewRenderer(), $this->params()->fromPost('subject') ); + if ($this->params()->fromPost('ccself') + && $view->from != $view->to + ) { + $mailer->sendLink( + $view->from, $view->from, $view->message, $url, + $this->getViewRenderer(), $this->params()->fromPost('subject') + ); + } return $this->output( $this->translate('email_success'), self::STATUS_OK ); diff --git a/themes/blueprint/templates/cart/email.phtml b/themes/blueprint/templates/cart/email.phtml index 33f8ca5d0bacbbd8cd6869738f9323728ed864e6..e7f3976cc326cba0812751a27f559e5f3916a423 100644 --- a/themes/blueprint/templates/cart/email.phtml +++ b/themes/blueprint/templates/cart/email.phtml @@ -23,4 +23,7 @@ <textarea id="email_message" name="message" rows="3" cols="40"><?=isset($this->message) ? $this->message : ''?></textarea> <br/> <input class="button" type="submit" name="submit" value="<?=$this->transEsc('Send')?>"/> + <? if ($this->disableFrom && $this->userEmailInFrom): ?> + <input type="checkbox" id="ccme" name="ccself"/><label for="ccme"><?=$this->translate('send_email_copy_to_me'); ?></label> + <? endif; ?> </form> diff --git a/themes/blueprint/templates/search/email.phtml b/themes/blueprint/templates/search/email.phtml index a87c97f8d60edce31e4e2be968c0cb8e629e386c..e026683a8e136a925d32ea1ccb9ace3232f4f8ef 100644 --- a/themes/blueprint/templates/search/email.phtml +++ b/themes/blueprint/templates/search/email.phtml @@ -19,4 +19,7 @@ <textarea id="email_message" name="message" rows="3" cols="40"><?=isset($this->message) ? $this->message : ''?></textarea> <br/> <input class="button" type="submit" name="submit" value="<?=$this->transEsc('Send')?>"/> + <? if ($this->disableFrom && $this->userEmailInFrom): ?> + <input type="checkbox" id="ccme" name="ccself"/><label for="ccme"><?=$this->translate('send_email_copy_to_me'); ?></label> + <? endif; ?> </form>