DEPRECATION WARNING

This documentation is not using the current rendering mechanism and is probably outdated. The extension maintainer should switch to the new system. Details on how to use the rendering mechanism can be found here.

Add new notification event

You can use notification API in your new controllers, to send notifications after some events.

  1. Place following snippet where you want to notify user.

    $notification = new Tx_Community_Service_Notification_Notification(
       'controllernameAction',      // notification event name – this name will be used in TypoScript configuration
                                    // by convention naming scheme like “controllerAction” is used.
       $this->requestingUser,   //sender
       $this->requestedUser    //recipient
    );
    // you can assign as many additional parameters as you want – Notification class implements magic getters
    // and setters. All parameters are automatically assigned to the message template (in case you use mailHandler).
    $notification->setFoo("BAR");
    $this->notificationService->notify($notification);
    
  2. Add configuration in TS for your new event

    controllernameAction  {
        10 {
            template = ControllernameAction
            handler = Tx_Community_Service_Notification_MailHandler
            serverEmail = {$plugin.tx_community.serverEmail}
        }
    }
    

See TypoScript reference for more configuration values.