Hooks

New hooks for the single view

There now are two new hooks for the single view. They are registered like this in ext_localconf.php:

$GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['seminars']['singleView'][]
      = 'EXT:seminarspaypal/Classes/Hooks/EventSingleView.php:' .
              '&Tx_Seminarspaypal_Hooks_EventSingleView';

They are used like this:

class Tx_Seminarspaypal_Hooks_SingleView implements Tx_Seminars_Interface_Hook_EventSingleView {

/**

* Modifies the event single view.

*

* @param tx_seminars_Model_Event $event

* the event to display in the single view

* @param Tx_Oelib_Template $template

* the template that will be used to create the single view output

*

* @return void

*/

public functionmodifyEventSingleView(tx_seminars_Model_Event$event, Tx_Oelib_Template$template) {…}

/**

* Modifies a list row in the time slots list (which is part of the event

* single view).

*

* @param tx_seminars_Model_TimeSlot $timeSlot

* the time slot to display in the current row

* @param Tx_Oelib_Template $template

* the template that will be used to create the list row output

*

* @return void

*/

public functionmodifyTimeSlotListRow(tx_seminars_Model_TimeSlot$timeSlot, Tx_Oelib_Template$template) {…}

New hooks for the list view

There now is a new hook for the list view. It’s registered like this in ext_localconf.php:

$GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['seminars']['listView'][]
      = 'EXT:seminarspaypal/Hooks/Classes/Hooks/ListView.php:' .
              '&Tx_Seminarspaypal_Hooks_ListView';

It’s used like this:

class Tx_Seminarspaypal_Hooks_ListView implements Tx_Seminars_Interface_Hook_EventListView {
     /**
      * Adds a countdown column.
    *
    * @param Tx_Seminars_Model_Event $event
    *        the affected registration
     * @param Tx_Oelib_Template $template
     *        the template from which the list row is built
     */
      public function modifyListRow(
              Tx_Seminars_Model_Event $event, Tx_Oelib_Template $template
      ) {}

     /**
      * Adds an "add to cart" PayPal button for non-free registrations that have
    * not been paid for.
    *
    * @param Tx_Seminars_Model_Registration $registration
    *        the affected registration
     * @param Tx_Oelib_Template $template
     *        the template from which the list row is built
     */
      public function modifyMyEventsListRow(
              Tx_Seminars_Model_Registration $registration, Tx_Oelib_Template $template
    ) {}

Hooks for the organizer notification e-mails

To use this hook, please create a class that implements the interface tx_seminars_Interface_Hook_Registration. The method in your class then should expect two parameters:

public function modifyOrganizerNotificationEmail(
      Tx_Seminars_OldModel_Registration $registration, Tx_Oelib_Template $emailTemplate
) {

Your class then needs to be included and registered like in this example:

// register my hook objects
$GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['seminars']['registration'][] = 'EXT:invoices/class.tx_invoices_email.php:tx_invoices_email';

Hooks for the thank-you e-mails sent after a registration

There are two hooks: one for modifying the e-mail (e.g., adding recipients or attachments), and one for modifying the e-mail texts before the corresponding subparts are rendered

Hook for the e-mail

To use this hook, you need to create a class with a method named modifyThankYouEmail. The method in your class should expect two parameters:

  public function modifyThankYouEmail(
        Tx_Oelib_Mail $email, Tx_Seminars_Model_Registration $registration
) {

Your class then needs to be included and registered like in this example:

// includes my hook class
require_once(\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extPath('invoices') . 'class.tx_invoices_email.php');

// register my hook objects
$GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['seminars']['registration'][] = 'EXT:invoices/class.tx_invoices_email.php:tx_invoices_email';

Hook for the e-mail text

To use this hook, please create a class that implements the interface tx_seminars_Interface_Hook_Registration. The method in your class then should expect two parameters:

public function modifyAttendeeEmailText(
             Tx_Seminars_OldModel_Registration $registration, Tx_Oelib_Template $emailTemplate
   ) {

Your class then needs to be included and registered like in this example:

// register my hook objects
$GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['seminars']['registration'][] = 'EXT:invoices/class.tx_invoices_email.php:tx_invoices_email';

Hooks for the salutation in all e-mails to the attendees

It is also possible to extend the salutation used in the e-mails with the following hook:

  • modifySalutation for tx_seminars_EmailSaluation which is called just before the salutation is returned by getSalutation

To use this hook, you need to create a class with a method named modifySalutation. The method in your class should only expect one parameter which is a reference to an array with the following structure:

array(‘dear’ => String, ‘title’ => String, ‘name’ => String)

Your class then needs to be included and registered like in this example:

// includes my hook class
require_once(\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extPath('rsys_seminars_ext') . 'class.tx_rsysseminarsext_modemailsalutation.php');

// register my hook objects
$GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['seminars']['modifyEmailSalutation'][] = 'EXT:rsyshook/class.tx_rsysseminarsext_modemailsalutation .php:tx_rsysseminarsext_modemailsalutation';

Hooks for the e-mails sent from the back-end module

The hook classes need to be registered and written like this:

$GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['seminars']['backEndModule'][]
      = 'EXT:seminarspaypal/Hooks/class.tx_seminarspaypal_Hooks_BackEndModule.php:' .
              '&tx_seminarspaypal_Hooks_BackEndModule';

It’s used like this:

class tx_seminarspaypal_Hooks_BackEndModule implements Tx_Seminars_Interface_Hook_BackEndModule {
      /**
     * Modifies the general e-mail sent via the back-end module.
     *
     * Note: This hook does not get called yet. It is just here so the interface
     * is finalized.
     *
     * @param Tx_Seminars_Model_Registration $registration
     *        the registration to which the e-mail refers
     * @param Tx_Oelib_Mail $eMail
     *        the e-mail that will be sent
     *
     * @return void
     */
      public function modifyGeneralEmail(Tx_Seminars_Model_Registration $registration, Tx_Oelib_Mail $eMail) {}

      /**
     * Modifies the confirmation e-mail sent via the back-end module.
     *
     * @param Tx_Seminars_Model_Registration $registration
     *        the registration to which the e-mail refers
     * @param Tx_Oelib_Mail $eMail
     *        the e-mail that will be sent
     *
     * @return void
     */
      public function modifyConfirmEmail(Tx_Seminars_Model_Registration $registration, Tx_Oelib_Mail $eMail) {}

      /**
     * Modifies the cancelation e-mail sent via the back-end module.
     *
     * Note: This hook does not get called yet. It is just here so the interface
     * is finalized.
     *
     * @param Tx_Seminars_Model_Registration $registration
     *        the registration to which the e-mail refers
     * @param Tx_Oelib_Mail $eMail
     *        the e-mail that will be sent
     *
     * @return void
     */
       public function modifyCancelEmail(Tx_Seminars_Model_Registration $registration, Tx_Oelib_Mail $eMail) {}

Please contact us if you need additional hooks.