[TYPO3-mvc] How I can send a message from a field to mail body?

Thomas Mammitzsch thomas at visualworx.de
Wed Dec 12 20:58:57 CET 2012


hi,

should be like $this->sendMail($senderEmail, $recipientEmail, $subject, 
$newQuestion->getDescription());

if your model has a getter for property $description.

regards, Thomas

On 12.12.2012 21:49, Дмитрий Васильев wrote:
> Hi all,
> I make extension with the questions list.
> I want to send the text, from the form to the admin email
>
> To send mail using this function in controller
>
> /**
> * send email using swiftmailer
> *
> * @param string $recipientEmail
> * @param string $subject
> * @param string $message
> * @param string $senderEmail
> * @param string $senderName
> * @return void
> */
> protected function sendMail($senderEmail, $recipientEmail, $subject, 
> $message) {
> $mail = t3lib_div::makeInstance('t3lib_mail_Message');
> $mail->setFrom( array( $this->settings['senderEmail'] => 
> $this->settings['senderName'] ) );
> $mail ->setTo($this->settings['recipientEmail']);
> $mail->setSubject($this->settings['subject']);
> $mail->setBody($message);
> $mail->send();
> }
>
> In new action use
>
> public function newAction(Tx_Userfaq_Domain_Model_Question 
> $newQuestion = NULL) {
> ....
> $this->sendMail($senderEmail, $recipientEmail, $subject, $message);
> ....
> }
>
> How I can send a message from a field 
> name="tx_userfaq_userfaq[newQuestion][description]" to mail body?
>
> ----------------------------------
> Thanks, Dmitry Vasiliev
> _______________________________________________
> TYPO3-project-typo3v4mvc mailing list
> TYPO3-project-typo3v4mvc at lists.typo3.org
> http://lists.typo3.org/cgi-bin/mailman/listinfo/typo3-project-typo3v4mvc



More information about the TYPO3-project-typo3v4mvc mailing list