Skip to content

Service

TLA edited this page Jul 6, 2018 · 2 revisions

SendMail

This class extends TYPO3's own mailing possibilities.

Usage

/** @var \Xima\XmTools\Service\SendMail $sendMail */
$sendMail = $this->objectManager->get(SendMail::class);
$sendMail->setMailContentType('text/html');
$sendMail->sendTemplateEmail(
   [{recipient e-mail} => {recipient name}],
   [{sender e-mail} => {sender name}],
   {subject},
   GeneralUtility::getFileAbsFileName({path to template}),
   [
                '{parameter}'         => {parameter},
   ],
   [],
   [],
   [GeneralUtility::getFileAbsFileName({layout root path})],
   [GeneralUtility::getFileAbsFileName({partial root path})]
);

Methods

To send an e-mail with an attachment

$sendMail->setAttachment({path to file});
Clone this wiki locally