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

Дмитрий Васильев dmitry at typo3.ru.net
Wed Dec 12 22:42:07 CET 2012


Thank you, Thomas. It's work.

12.12.2012 22:58, Thomas Mammitzsch пишет:
> 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
>
> _______________________________________________
> 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