/**
  *
  * Sends a mail with a certain subject and bodytext to a recipient in form of a
  * frontend user.
  *
  * @param        \TYPO3\CMS\Extbase\Domain\Model\FrontendUser $recipient
  *                                                             The recipient of the mail. This is a plain
  *                                                             frontend user.
  * @param string $subject                                     The mail's subject
  * @param string $bodyText                                    The mail's bodytext
  *
  * @return void
  *
  */
 public function sendMail(\TYPO3\CMS\Extbase\Domain\Model\FrontendUser $recipient, $subject, $bodyText)
 {
     if ($recipient->getEmail()) {
         $mail = new \TYPO3\CMS\Core\Mail\MailMessage();
         $mail->setTo(array($recipient->getEmail()))->setFrom($this->getDefaultSenderAddress(), $this->getDefaultSenderName())->setSubject($subject)->setBody($bodyText)->send();
     }
 }
 public function embed($image)
 {
     return $this->emailObj->embed(Swift_Image::fromPath($image));
 }
예제 #3
0
파일: Typo3.php 프로젝트: nos3/ai-typo3
 /**
  * Initializes the message instance.
  *
  * @param TYPO3\CMS\Core\Mail\MailMessage $object TYPO3 mail object
  * @param string $charset Default charset of the message
  */
 public function __construct(TYPO3\CMS\Core\Mail\MailMessage $object, $charset)
 {
     $object->setCharset($charset);
     $this->_object = $object;
 }