Skip to content
Snippets Groups Projects
Commit bbeeeda7 authored by Demian Katz's avatar Demian Katz
Browse files

Style fix; reduced redundancy.

parent 5b9bedc8
No related merge requests found
......@@ -365,14 +365,15 @@ class AbstractRecord extends AbstractBase
if ($this->formWasSubmitted('submit', $view->useRecaptcha)) {
// Attempt to send the email and show an appropriate flash message:
try {
$this->getServiceLocator()->get('VuFind\Mailer')->sendRecord(
$mailer = $this->getServiceLocator()->get('VuFind\Mailer');
$mailer->sendRecord(
$view->to, $view->from, $view->message, $driver,
$this->getViewRenderer()
);
if ($this->params()->fromPost('ccself')
&& $view->from != $view->to
) {
$this->getServiceLocator()->get('VuFind\Mailer')->sendRecord(
$mailer->sendRecord(
$view->from, $view->from, $view->message, $driver,
$this->getViewRenderer()
);
......
......@@ -1032,14 +1032,15 @@ class AjaxController extends AbstractBase
$this->params()->fromPost('source', 'VuFind')
);
$view = $this->createEmailViewModel();
$this->getServiceLocator()->get('VuFind\Mailer')->sendRecord(
$mailer = $this->getServiceLocator()->get('VuFind\Mailer');
$mailer->sendRecord(
$view->to, $view->from, $view->message, $record,
$this->getViewRenderer()
);
if ($this->params()->fromPost('ccself')
&& $view->from != $view->to
) {
$this->getServiceLocator()->get('VuFind\Mailer')->sendRecord(
$mailer->sendRecord(
$view->from, $view->from, $view->message, $record,
$this->getViewRenderer()
);
......
......@@ -216,14 +216,15 @@ class CartController extends AbstractBase
// Attempt to send the email and show an appropriate flash message:
try {
// If we got this far, we're ready to send the email:
$this->getServiceLocator()->get('VuFind\Mailer')->sendLink(
$mailer = $this->getServiceLocator()->get('VuFind\Mailer');
$mailer->sendLink(
$view->to, $view->from, $view->message,
$url, $this->getViewRenderer(), 'bulk_email_title'
);
if ($this->params()->fromPost('ccself')
&& $view->from != $view->to
) {
$this->getServiceLocator()->get('VuFind\Mailer')->sendLink(
$mailer->sendLink(
$view->from, $view->from, $view->message,
$url, $this->getViewRenderer(), 'bulk_email_title'
);
......
......@@ -113,16 +113,17 @@ class SearchController extends AbstractSearch
// Attempt to send the email and show an appropriate flash message:
try {
// If we got this far, we're ready to send the email:
$this->getServiceLocator()->get('VuFind\Mailer')->sendLink(
$mailer = $this->getServiceLocator()->get('VuFind\Mailer');
$mailer->sendLink(
$view->to, $view->from, $view->message,
$view->url, $this->getViewRenderer()
);
if ($this->params()->fromPost('ccself')
&& $view->from != $view->to
) {
$this->getServiceLocator()->get('VuFind\Mailer')->sendLink(
$view->from, $view->from, $view->message,
$view->url, $this->getViewRenderer()
$mailer->sendLink(
$view->from, $view->from, $view->message,
$view->url, $this->getViewRenderer()
);
}
$this->flashMessenger()->setNamespace('info')
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment