vendor/terminal42/notification_center/config/config.php line 51

Open in your IDE?
  1. <?php
  2. /**
  3.  * notification_center extension for Contao Open Source CMS
  4.  *
  5.  * @copyright  Copyright (c) 2008-2015, terminal42
  6.  * @author     terminal42 gmbh <info@terminal42.ch>
  7.  * @license    LGPL
  8.  */
  9. /**
  10.  * Back end modules
  11.  */
  12. array_insert($GLOBALS['BE_MOD'], 1, array
  13. (
  14.     'notification_center' => array
  15.     (
  16.         'nc_notifications' => array
  17.         (
  18.             'tables'        => array('tl_nc_notification''tl_nc_message''tl_nc_language'),
  19.             'icon'          => 'system/modules/notification_center/assets/notification.png',
  20.         ),
  21.         'nc_queue' => array
  22.         (
  23.             'tables'        => array('tl_nc_queue'),
  24.             'icon'          => 'system/modules/notification_center/assets/queue.png',
  25.             're-queue'      => array('NotificationCenter\tl_nc_queue''reQueue')
  26.         ),
  27.         'nc_gateways' => array
  28.         (
  29.             'tables'        => array('tl_nc_gateway'),
  30.             'icon'          => 'system/modules/notification_center/assets/gateway.png'
  31.         )
  32.     )
  33. ));
  34. // Load icon in Contao 4.2 backend
  35. if ('BE' === TL_MODE) {
  36.     if (version_compare(VERSION'4.4''<')) {
  37.         $GLOBALS['TL_CSS'][] = 'system/modules/notification_center/assets/backend.css';
  38.     } else {
  39.         $GLOBALS['TL_CSS'][] = 'system/modules/notification_center/assets/backend_svg.css';
  40.     }
  41. }
  42. /**
  43.  * Front end modules
  44.  */
  45. $GLOBALS['FE_MOD']['user']['lostPasswordNotificationCenter'] = 'ModulePasswordNotificationCenter';
  46. if (in_array('newsletter', \ModuleLoader::getActive(), true)) {
  47.     $GLOBALS['FE_MOD']['newsletter']['newsletterSubscribeNotificationCenter']   = 'ModuleNewsletterSubscribeNotificationCenter';
  48.     $GLOBALS['FE_MOD']['newsletter']['newsletterActivateNotificationCenter']    = 'ModuleNewsletterActivateNotificationCenter';
  49.     $GLOBALS['FE_MOD']['newsletter']['newsletterUnsubscribeNotificationCenter'] = 'ModuleNewsletterUnsubscribeNotificationCenter';
  50. }
  51. /**
  52.  * Models
  53.  */
  54. $GLOBALS['TL_MODELS']['tl_nc_notification']             = 'NotificationCenter\Model\Notification';
  55. $GLOBALS['TL_MODELS']['tl_nc_gateway']                  = 'NotificationCenter\Model\Gateway';
  56. $GLOBALS['TL_MODELS']['tl_nc_language']                 = 'NotificationCenter\Model\Language';
  57. $GLOBALS['TL_MODELS']['tl_nc_message']                  = 'NotificationCenter\Model\Message';
  58. $GLOBALS['TL_MODELS']['tl_nc_queue']                    = 'NotificationCenter\Model\QueuedMessage';
  59. /**
  60.  * Cron jobs
  61.  */
  62. $GLOBALS['TL_CRON']['minutely'][] = array('NotificationCenter\Frontend\PoorMansCron''minutely');
  63. $GLOBALS['TL_CRON']['hourly'][]   = array('NotificationCenter\Frontend\PoorMansCron''hourly');
  64. $GLOBALS['TL_CRON']['daily'][]    = array('NotificationCenter\Frontend\PoorMansCron''daily');
  65. $GLOBALS['TL_CRON']['weekly'][]   = array('NotificationCenter\Frontend\PoorMansCron''weekly');
  66. $GLOBALS['TL_CRON']['monthly'][]  = array('NotificationCenter\Frontend\PoorMansCron''monthly');
  67. /**
  68.  * Hooks
  69.  */
  70. $GLOBALS['TL_HOOKS']['addCustomRegexp'][]       = array('NotificationCenter\AutoSuggester''verifyTokens');
  71. $GLOBALS['TL_HOOKS']['processFormData'][]       = array('NotificationCenter\tl_form''sendFormNotification');
  72. $GLOBALS['TL_HOOKS']['createNewUser'][]         = array('NotificationCenter\ContaoHelper''sendRegistrationEmail');
  73. $GLOBALS['TL_HOOKS']['updatePersonalData'][]    = array('NotificationCenter\ContaoHelper''sendPersonalDataEmail');
  74. $GLOBALS['TL_HOOKS']['getUserNavigation'][]     = array('NotificationCenter\ContaoHelper''addQueueToUserNavigation');
  75. $GLOBALS['TL_HOOKS']['activateAccount'][]       = array('NotificationCenter\ContaoHelper''sendActivationEmail');
  76. $GLOBALS['TL_HOOKS']['getSystemMessages'][]     = array('NotificationCenter\ContaoHelper''alertLegacySmtpSetting');
  77. /**
  78.  * Queue manager
  79.  */
  80. $GLOBALS['NOTIFICATION_CENTER']['QUEUE_MANAGER'] = new \NotificationCenter\Queue\QueueManager();
  81. /**
  82.  * Notification Center Gateways
  83.  */
  84. $GLOBALS['NOTIFICATION_CENTER']['GATEWAY'] = array_merge(
  85.     (array) ($GLOBALS['NOTIFICATION_CENTER']['GATEWAY'] ?? []),
  86.     array(
  87.          'queue'    => 'NotificationCenter\Gateway\Queue',
  88.          'email'    => 'NotificationCenter\Gateway\Email',
  89.          'file'     => 'NotificationCenter\Gateway\File',
  90.          'postmark' => 'NotificationCenter\Gateway\Postmark',
  91.     )
  92. );
  93. /**
  94.  * Notification Center Notification Types
  95.  */
  96. $GLOBALS['NOTIFICATION_CENTER']['NOTIFICATION_TYPE'] = array_merge_recursive(
  97.     (array) ($GLOBALS['NOTIFICATION_CENTER']['NOTIFICATION_TYPE'] ?? []),
  98.     array(
  99.          'contao' => array(
  100.              'core_form' => array(
  101.                  'recipients'           => array('admin_email''form_*''formconfig_*'),
  102.                  'email_subject'        => array('form_*''formconfig_*''admin_email'),
  103.                  'email_text'           => array('form_*''formconfig_*''formlabel_*''raw_data''raw_data_filled''admin_email'),
  104.                  'email_html'           => array('form_*''formconfig_*''formlabel_*''raw_data''raw_data_filled''admin_email'),
  105.                  'file_name'            => array('form_*''formconfig_*''admin_email'),
  106.                  'file_content'         => array('form_*''formconfig_*''formlabel_*''raw_data''raw_data_filled''admin_email'),
  107.                  'email_sender_name'    => array('admin_email''form_*''formconfig_*'),
  108.                  'email_sender_address' => array('admin_email''form_*''formconfig_*'),
  109.                  'email_recipient_cc'   => array('admin_email''form_*''formconfig_*'),
  110.                  'email_recipient_bcc'  => array('admin_email''form_*''formconfig_*'),
  111.                  'email_replyTo'        => array('admin_email''form_*''formconfig_*'),
  112.                  'attachment_tokens'    => array('form_*''formconfig_*'),
  113.              ),
  114.              'member_activation' => array(
  115.                  'recipients'           => array('member_email''admin_email'),
  116.                  'email_subject'        => array('domain''member_*''admin_email'),
  117.                  'email_text'           => array('domain''member_*''admin_email'),
  118.                  'email_html'           => array('domain''member_*''admin_email'),
  119.                  'file_name'            => array('domain''member_*''admin_email'),
  120.                  'file_content'         => array('domain''member_*''admin_email'),
  121.                  'email_sender_name'    => array('admin_email''form_*'),
  122.                  'email_sender_address' => array('admin_email''form_*'),
  123.                  'email_recipient_cc'   => array('admin_email''member_*'),
  124.                  'email_recipient_bcc'  => array('admin_email''member_*'),
  125.                  'email_replyTo'        => array('admin_email''member_*'),
  126.              ),
  127.              'member_registration' => array(
  128.                  'recipients'           => array('member_email''admin_email'),
  129.                  'email_subject'        => array('domain''link''member_*''admin_email'),
  130.                  'email_text'           => array('domain''link''member_*''admin_email'),
  131.                  'email_html'           => array('domain''link''member_*''admin_email'),
  132.                  'file_name'            => array('domain''link''member_*''admin_email'),
  133.                  'file_content'         => array('domain''link''member_*''admin_email'),
  134.                  'email_sender_name'    => array('admin_email''member_*'),
  135.                  'email_sender_address' => array('admin_email''member_*'),
  136.                  'email_recipient_cc'   => array('admin_email''member_*'),
  137.                  'email_recipient_bcc'  => array('admin_email''member_*'),
  138.                  'email_replyTo'        => array('admin_email''member_*'),
  139.              ),
  140.              'member_personaldata' => array(
  141.                  'recipients'           => array('member_email''admin_email'),
  142.                  'email_subject'        => array('domain''member_*''member_old_*''changed_*''admin_email'),
  143.                  'email_text'           => array('domain''member_*''member_old_*''changed_*''admin_email'),
  144.                  'email_html'           => array('domain''member_*''member_old_*''changed_*''admin_email'),
  145.                  'email_sender_name'    => array('member_*'),
  146.                  'email_sender_address' => array('member_email''admin_email'),
  147.                  'email_recipient_cc'   => array('member_email''admin_email'),
  148.                  'email_recipient_bcc'  => array('member_email''admin_email'),
  149.                  'email_replyTo'        => array('member_email''admin_email'),
  150.              ),
  151.              'member_password'     => array(
  152.                  'recipients'           => array('recipient_email'),
  153.                  'email_subject'        => array('domain''link''member_*''recipient_email'),
  154.                  'email_text'           => array('domain''link''member_*''recipient_email'),
  155.                  'email_html'           => array('domain''link''member_*''recipient_email'),
  156.                  'file_name'            => array('domain''link''member_*''recipient_email'),
  157.                  'file_content'         => array('domain''link''member_*''recipient_email'),
  158.                  'email_sender_name'    => array('recipient_email'),
  159.                  'email_sender_address' => array('recipient_email'),
  160.                  'email_recipient_cc'   => array('recipient_email'),
  161.                  'email_recipient_bcc'  => array('recipient_email'),
  162.                  'email_replyTo'        => array('recipient_email'),
  163.              ),
  164.          )
  165.     )
  166. );
  167. // Add the newsletter tokens only if the extension is active
  168. if (in_array('newsletter', \Contao\ModuleLoader::getActive(), true)) {
  169.     $GLOBALS['NOTIFICATION_CENTER']['NOTIFICATION_TYPE']['contao']['newsletter_subscribe'] = array(
  170.         'recipients'           => array('recipient_email''admin_email'),
  171.         'email_subject'        => array('domain''link''recipient_email''admin_email''channels''channel_ids''subject'),
  172.         'email_text'           => array('domain''link''recipient_email''admin_email''channels''channel_ids''token'),
  173.         'email_html'           => array('domain''link''recipient_email''admin_email''channels''channel_ids''token'),
  174.         'file_name'            => array('domain''link''recipient_email''admin_email''channels''channel_ids'),
  175.         'file_content'         => array('domain''link''recipient_email''admin_email''channels''channel_ids''token'),
  176.         'email_sender_name'    => array('recipient_email''admin_email''admin_name'),
  177.         'email_sender_address' => array('recipient_email''admin_email'),
  178.         'email_recipient_cc'   => array('recipient_email''admin_email'),
  179.         'email_recipient_bcc'  => array('recipient_email''admin_email'),
  180.         'email_replyTo'        => array('recipient_email''admin_email'),
  181.     );
  182.     $GLOBALS['NOTIFICATION_CENTER']['NOTIFICATION_TYPE']['contao']['newsletter_activate'] = array(
  183.         'recipients'           => array('recipient_email''admin_email'),
  184.         'email_subject'        => array('domain''recipient_email''admin_email''channels''channel_ids''subject'),
  185.         'email_text'           => array('domain''recipient_email''admin_email''channels''channel_ids'),
  186.         'email_html'           => array('domain''recipient_email''admin_email''channels''channel_ids'),
  187.         'file_name'            => array('domain''recipient_email''admin_email''channels''channel_ids'),
  188.         'file_content'         => array('domain''recipient_email''admin_email''channels''channel_ids'),
  189.         'email_sender_name'    => array('recipient_email''admin_email''admin_name'),
  190.         'email_sender_address' => array('recipient_email''admin_email'),
  191.         'email_recipient_cc'   => array('recipient_email''admin_email'),
  192.         'email_recipient_bcc'  => array('recipient_email''admin_email'),
  193.         'email_replyTo'        => array('recipient_email''admin_email'),
  194.     );
  195.     $GLOBALS['NOTIFICATION_CENTER']['NOTIFICATION_TYPE']['contao']['newsletter_unsubscribe'] = array(
  196.         'recipients'           => array('recipient_email''admin_email'),
  197.         'email_subject'        => array('domain''recipient_email''admin_email''channels''channel_ids''subject'),
  198.         'email_text'           => array('domain''recipient_email''admin_email''channels''channel_ids'),
  199.         'email_html'           => array('domain''recipient_email''admin_email''channels''channel_ids'),
  200.         'file_name'            => array('domain''recipient_email''admin_email''channels''channel_ids'),
  201.         'file_content'         => array('domain''recipient_email''admin_email''channels''channel_ids'),
  202.         'email_sender_name'    => array('recipient_email''admin_email''admin_name'),
  203.         'email_sender_address' => array('recipient_email''admin_email'),
  204.         'email_recipient_cc'   => array('recipient_email''admin_email'),
  205.         'email_recipient_bcc'  => array('recipient_email''admin_email'),
  206.         'email_replyTo'        => array('recipient_email''admin_email'),
  207.     );
  208. }