/** * Send Optin Confirmation Mail to user * * @param Mail $mail * @return void */ protected function sendConfirmationMail(Mail &$mail) { $email = ['template' => 'Mail/OptinMail', 'receiverName' => $this->mailRepository->getSenderNameFromArguments($mail, [$this->conf['sender.']['default.'], 'senderName']), 'receiverEmail' => $this->mailRepository->getSenderMailFromArguments($mail), 'senderName' => $this->settings['sender']['name'], 'senderEmail' => $this->settings['sender']['email'], 'subject' => $this->contentObject->cObjGetSingle($this->conf['optin.']['subject'], $this->conf['optin.']['subject.']), 'rteBody' => '', 'format' => $this->settings['sender']['mailformat'], 'variables' => ['hash' => OptinUtility::createOptinHash($mail), 'mail' => $mail]]; TypoScriptUtility::overwriteValueFromTypoScript($email['receiverName'], $this->conf['optin.']['overwrite.'], 'name'); TypoScriptUtility::overwriteValueFromTypoScript($email['receiverEmail'], $this->conf['optin.']['overwrite.'], 'email'); TypoScriptUtility::overwriteValueFromTypoScript($email['senderName'], $this->conf['optin.']['overwrite.'], 'senderName'); TypoScriptUtility::overwriteValueFromTypoScript($email['senderEmail'], $this->conf['optin.']['overwrite.'], 'senderEmail'); $this->sendMailService->sendEmailPreflight($email, $mail, $this->settings, 'optin'); }
/** * Send the mail * * @param array $email Array with all needed mail information * @return bool Mail successfully sent */ protected function sendTemplateEmail(array $email) { /** @var MailMessage $message */ $message = GeneralUtility::makeInstance('TYPO3\\CMS\\Core\\Mail\\MailMessage'); TypoScriptUtility::overwriteValueFromTypoScript($email['subject'], $this->overwriteConfiguration, 'subject'); $message->setTo(array($email['receiverEmail'] => $email['receiverName']))->setFrom(array($email['senderEmail'] => $email['senderName']))->setSubject($email['subject'])->setCharset(FrontendUtility::getCharset()); $message = $this->addCc($message); $message = $this->addBcc($message); $message = $this->addReturnPath($message); $message = $this->addReplyAddresses($message); $message = $this->addPriority($message); $message = $this->addAttachmentsFromUploads($message); $message = $this->addAttachmentsFromTypoScript($message); $message = $this->addHtmlBody($message, $email); $message = $this->addPlainBody($message, $email); $this->signalSlotDispatcher->dispatch(__CLASS__, __FUNCTION__ . 'BeforeSend', array($message, $email, $this->mail, $this->settings, $this->type)); $message->send(); $this->updateMail($email); return $message->isSent(); }
/** * Get email string from TypoScript overwrite * * @return array */ protected function overWriteEmailsWithTypoScript() { $receiverString = ''; TypoScriptUtility::overwriteValueFromTypoScript($receiverString, $this->configuration['receiver.']['overwrite.'], 'email'); return $this->parseEmailsFromString($receiverString); }