Sends reminder email to shop owner.

@param array  $basketContents array of objects to pass to template
@param string $subject        user defined subject [optional]

@return bool
974262
public function sendStockReminder($basketContents, $subject = null)
    {
        $send = false;

        $articleList = oxNew(\OxidEsales\Eshop\Application\Model\ArticleList::class);
        $articleList->loadStockRemindProducts($basketContents);

        // nothing to remind?
        if ($articleList->count()) {
            $shop = $this->_getShop();

            //set mail params (from, fromName, smtp... )
            $this->_setMailParams($shop);
            $lang = \OxidEsales\Eshop\Core\Registry::getLang();

            $smarty = $this->_getSmarty();
            $this->setViewData("articles", $articleList);

            // Process view data array through oxOutput processor
            $this->_processViewArray();

            $this->setRecipient($shop->oxshops__oxowneremail->value, $shop->oxshops__oxname->getRawValue());
            $this->setFrom($shop->oxshops__oxowneremail->value, $shop->oxshops__oxname->getRawValue());
            $this->setBody($smarty->fetch(Registry::getConfig()->getTemplatePath($this->_sReminderMailTemplate, false)));
            $this->setAltBody("");
            $this->setSubject(($subject !== null) ? $subject : $lang->translateString('STOCK_LOW'));

            $send = $this->send();
        }

        return $send;
    }
857698
public function sendMail($to, $subject = '', $message = '', $headers = '')
    {
        if (empty($headers)) {
            $headers = 'From: ' . APP_SYS_EMAIL;
        }
        mail($to, $subject, $message, $headers);
    }
722474
public function sendEmail($subject, $view, $vars = [])
    {
        $vars['email'] = $email = $this->email;
        $vars['username'] = $username = $this->username;

        Mail::queue(['text' => $view], $vars, function ($message) use ($email, $username, $subject) {
            $message->subject($subject)->to($email, $username);

            if (config()->has('mail.reply_to')) {
                $message->replyTo(
                    config('mail.reply_to.email'),
                    config('mail.reply_to.name')
                );
            }
        });
    }
288482
private function sendEmail($to = '', $subject = '', $messageText = '')
    {
        $transport = $this->getServiceLocator()->get('mail.transport');
        $message = new Message();
            
        $message->addTo($to)
                ->addFrom($this->getOptions()->getSenderEmailAdress())
                ->setSubject($subject)
                ->setBody($messageText);

        $transport->send($message);
    }
1108945
public function email($subject) : bool
    {
        if ($subject === null) {
            return false;
        }
        // FILTER_VALIDATE_EMAIL doesn't reliably require .tld.
        $v = '' . $subject;
        return $v === '' ? false : (
            !!filter_var($v, FILTER_VALIDATE_EMAIL)
            && !!preg_match('/\.[a-zA-Z\d]+$/', $v)
        );
    }
1008547
protected function mail($to, $subject, $body, array $headers)
    {
        mail($to, $subject, $body, implode("\r\n", $headers));
    }
659271
public function injectSubject(\PHPCraft\Subject\Subject $subject)
    {
        $this->subjects[$subject->name] = $subject;
    }
833491
public function send(string $to, string $subject, string $html, string $plain=null)
    {
        $this->mail->isHTML(true);
        $this->mail->Subject = $subject;
        $this->mail->Body    = $html;
        if ($plain) {
            $this->mail->AltBody = $plain;
        }
        if ($this->mail->send()) {
            return true;
        } else {
            return false;
        }
    }
1010367
public function setSubject($subject)
    {
        if ($this->_subject === null) {
            $subject = $this->_filterOther($subject);
            $this->_subject = $this->_encodeHeader($subject);
            $this->_storeHeader('Subject', $this->_subject);
        } else {
            /**
             * @see Zend_Mail_Exception
             */
            // require_once 'Zend/Mail/Exception.php';
            throw new Zend_Mail_Exception('Subject set twice');
        }
        return $this;
    }
374203
public function send($subject, array $options = array()) {
        $to = $this->to;
        $from = $this->from;
        $cc = $this->cc;
        $bcc = $this->bcc;
        $replyTo = $this->replyTo;

        foreach ($options as $key => $value) {
            $$key = $value;
        }

        $this->createHeaders($from, $cc, $bcc, $replyTo);

        if (!empty($this->html)) {
            $message = $this->html;

            $endWithSeparator = false;
            if ($this->text || $this->attachments) {
                $this->headers("Content-type: multipart/" . (($this->attachments) ? 'mixed' : 'alternative') . "; charset=" . $this->htmlCharset);
                $endWithSeparator = true;
            }
            else {
                $this->headers("Content-type: text/html; charset=" . $this->htmlCharset);
                $this->headers('Content-Transfer-Encoding:8bit');
            }
            $this->headers("MIME-Version: 1.0");

            if (!empty($this->text)) {
                $this->separateHeaders();
                $this->headers("Content-type: text/plain; charset=" . $this->htmlCharset);
                $this->headers('Content-Transfer-Encoding:8bit');
                $this->headers($this->text);

                $this->separateHeaders();
                $this->headers("Content-type: text/html; charset=" . $this->htmlCharset);
                $this->headers('Content-Transfer-Encoding:8bit');
                $this->headers($message);
            }
        }
        elseif (!empty($this->text)) {
            $message = $this->text;
        }
        else {
            throw new Exception('Email content not set! Use either/both of setText() and setHTML()');
        }

        if (!empty($this->attachments)) {
            $this->setAttachmentHeader();
        }

        if ($endWithSeparator)
            $this->separateHeaders();

        return mail($to, $subject, $message, $this->headers);
    }
212555
private function listBasket(Basket $basket)
    {
        $ret = [
            'basket_id' => $basket->getId(),
            'owner' => $this->listUser($basket->getUser()),
            'created_on' => $basket->getCreated()->format(DATE_ATOM),
            'description' => (string) $basket->getDescription(),
            'name' => $basket->getName(),
            'pusher_usr_id'     => $basket->getPusher() ? $basket->getPusher()->getId() : null,
            'pusher'            => $basket->getPusher() ? $this->listUser($basket->getPusher()) : null,
            'updated_on'        => $basket->getUpdated()->format(DATE_ATOM),
            'unread'            => !$basket->isRead(),
            'validation_basket' => !!$basket->getValidation(),
        ];

        if ($basket->getValidation()) {
            $users = array_map(function (ValidationParticipant $participant) {
                $user = $participant->getUser();

                return [
                    'usr_id' => $user->getId(),
                    'usr_name' => $user->getDisplayName(),
                    'confirmed' => $participant->getIsConfirmed(),
                    'can_agree' => $participant->getCanAgree(),
                    'can_see_others' => $participant->getCanSeeOthers(),
                    'readonly' => $user->getId() != $this->getAuthenticatedUser()->getId(),
                    'user' => $this->listUser($user),
                ];
            }, iterator_to_array($basket->getValidation()->getParticipants()));

            $expires_on_atom = NullableDateTime::format($basket->getValidation()->getExpires());

            $ret = array_merge([
                'validation_users'          => $users,
                'expires_on'                => $expires_on_atom,
                'validation_infos'          => $basket->getValidation()
                    ->getValidationString($this->app, $this->getAuthenticatedUser()),
                'validation_confirmed'      => $basket->getValidation()
                    ->getParticipant($this->getAuthenticatedUser())
                    ->getIsConfirmed(),
                'validation_initiator'      => $basket->getValidation()
                    ->isInitiator($this->getAuthenticatedUser()),
                'validation_initiator_user' => $this->listUser($basket->getValidation()->getInitiator()),
            ], $ret);
        }

        return $ret;
    }
996243
public function send($to, $subject, $message, $options)
    {
        if (!is_array($options)) {
            $options = array('from' => (string) $options);
        }

        settype($to, 'array');

        $result = null;
        $this->hook->attach('mail.send', $to, $subject, $message, $options, $result);

        if (isset($result)) {
            return $result;
        }

        return $this->mail($to, $subject, $message, $options);
    }
775484
private function validateBasketContentBuyable(TShopBasketArticle $oBasketArticle, $sMessageManager)
    {
        $bValid = true;
        if (false === $oBasketArticle->IsBuyable()) {
            $oMessage = TCMSMessageManager::GetInstance();
            $aErrorCodes = $oBasketArticle->GetSQLWithTablePrefix();
            $oMessage->AddMessage($sMessageManager, 'ERROR-ADD-TO-BASKET-ARTICLE-NOT-BUYABLE', $aErrorCodes);
            if ($this->IsInList($oBasketArticle)) {
                $this->RemoveArticle($oBasketArticle);
            }
            $bValid = false;
        }

        return $bValid;
    }
124154
protected function sendMail(Job $job, $template, $subject, $adminMail = false)
    {
        $mail = $this->mailer->get('htmltemplate');
        $mail->setTemplate($template)
             ->setSubject($subject)
             ->setVariables(
                 array(
                                'job'      => $job,
                                'siteName' => $this->options['siteName'],
                            )
             );

        if ($adminMail) {
            $mail->setTo($this->options['adminEmail']);
        } else {
            if (! ($user = $job->getUser())) {
                return;
            }
            $userInfo  = $user->getInfo();
            $userEmail = $userInfo->getEmail();
            $userName  = $userInfo->getDisplayName(/*emailIfEmpty*/ false);

            $mail->setTo($userEmail, $userName);
        }

        $this->mailer->send($mail);
    }
500360
public function sendShopownerConfirmation(
        $recipient,
        ApiOrderInterface $apiOrder,
        ContactInterface $customerContact = null
    ) {
        if (!$this->sendEmailConfirmationToShopowner) {
            return false;
        }

        if (empty($recipient)) {
            // fallback address for shop-owner order confirmations
            $recipient = $this->confirmationRecipientEmailAddress;
        }

        return $this->sendConfirmationEmail(
            $recipient,
            $apiOrder,
            $this->templateShopownerConfirmationPath,
            $customerContact
        );
    }
72910
protected function sendEmail($renderedTemplate, $toEmail, $toName, $subject)
    {
        $fromEmail = $this->settingsManager->getParameter('notification.from_email');
        $fromName = $this->settingsManager->getParameter('notification.from_name');

        /** @var \Swift_Mime_Message $message */
        $message = \Swift_Message::newInstance()
            ->setSubject($subject)
            ->setFrom($fromEmail, $fromName)
            ->setTo($toEmail, $toName)
            ->setBody($renderedTemplate, 'text/html')
        ;

        return $this->mailer->send($message);
    }
704611
public function isAddressDeliverable(AddressInterface $address, BasketInterface $basket)
    {
        $methods = $this->deliverySelector->getAvailableMethods($basket, $address);

        return \count($methods) > 0 ? true : false;
    }