[TYPO3-mvc] How to send an email after createAction?

Dimanche eat.dimanche at yjj.com
Tue Dec 1 03:10:41 CET 2009


Jochen Rau wrote:
> Hi Dimance.
> 
> Dimanche wrote:
>>> why not just write your createAction like this:
>>>
>>> createAction(User $user) {
>>> $this->userRepository->add($user);
>>> $this->emailService->sendRegistrationEmail($user);
>>> }
>>>
>>> Greets,
>>> Sebastian
>> Hi Sebastian,
>>
>> I have tested yours function, but it shown the error message
>>
>> "Call to a member function sendRegistrationEmail() on a non-object".
> 
> That's because there is no emailService shipped with Extbase. You have 
> to implement your own. Put you class file in 
> typo3conf/ext/my_ext/Classes/Domain/Service/EmailService.php.
> 
>> I don't know which class I need to extend my new object, please writing
>> down by detail, how can I use the function 
>> "sendRegistrationEmail($user)"?
> 
> The class EmailService.php could be something like
> 
> class Tx_MxExt_Domain_Service_EmailService {
> 
>     public function sendRegistrationEmail(Tx_MxClass_Domain_Model_Client 
> $client) {
>         // implement your code to send an email here
>         // tslib_cObj::sendNotifyEmail
>     }
> }
> 
> Regards
> Jochen
> 
> 
> 
Hi,

Thanks very much for your helping.


Regards,
Dimanche


More information about the TYPO3-project-typo3v4mvc mailing list