diff --git a/src/com_tjnotifications/admin/config.xml b/src/com_tjnotifications/admin/config.xml index 1d3e5a32..50faf3ff 100644 --- a/src/com_tjnotifications/admin/config.xml +++ b/src/com_tjnotifications/admin/config.xml @@ -36,6 +36,18 @@ +
+ +
+
diff --git a/src/com_tjnotifications/admin/defines.php b/src/com_tjnotifications/admin/defines.php index 6dbd0a01..d17f5054 100644 --- a/src/com_tjnotifications/admin/defines.php +++ b/src/com_tjnotifications/admin/defines.php @@ -12,5 +12,5 @@ if (!defined('TJNOTIFICATIONS_CONST_BACKENDS_ARRAY')) { - define('TJNOTIFICATIONS_CONST_BACKENDS_ARRAY', "email,sms"); + define('TJNOTIFICATIONS_CONST_BACKENDS_ARRAY', "email,sms,webhook"); } diff --git a/src/com_tjnotifications/admin/language/en-GB.com_tjnotifications.ini b/src/com_tjnotifications/admin/language/en-GB.com_tjnotifications.ini index bf4af7d6..46653bdd 100644 --- a/src/com_tjnotifications/admin/language/en-GB.com_tjnotifications.ini +++ b/src/com_tjnotifications/admin/language/en-GB.com_tjnotifications.ini @@ -286,3 +286,28 @@ COM_TJNOTIFICATIONS_NOTIFICATION_SMS_REMAINING_EXCEEDED="characters exceeded" ; Notification - SMS provider template ID COM_TJNOTIFICATIONS_FIELD_SMS_TEMPLATE_ID_LABEL="SMS template ID" COM_TJNOTIFICATIONS_FIELD_SMS_TEMPLATE_ID_DESC="Set template ID which is proided by SMS provider" + +; Since __DEPLOY_VERSION__ +; Notification - Webhook support +COM_TJNOTIFICATIONS_SETTINGS_WEBHOOK="Webhook" +COM_TJNOTIFICATIONS_FIELD_WEBHOOK_URL_SUBFORM_LABEL="Add Custom Webhook URLs" +COM_TJNOTIFICATIONS_FIELD_WEBHOOK_URL_SUBFORM_DESC="Enter custom webhook URL for your Webhook notification" +COM_TJNOTIFICATIONS_FIELD_WEBHOOK_URL_LABEL="Webhook URL" +COM_TJNOTIFICATIONS_FIELD_WEBHOOK_URL_DESC="Enter URL for your Webhook notification" +COM_TJNOTIFICATIONS_FIELD_WEBHOOK_BODY_LABEL="Webhook Body" +COM_TJNOTIFICATIONS_FIELD_WEBHOOK_BODY_DESC="Enter body for your Webhook notification" +COM_TJNOTIFICATIONS_FIELD_WEBHOOK_STATUS_LABEL="Webhook Status" +COM_TJNOTIFICATIONS_FIELD_WEBHOOK_STATUS_DESC="Turn on this after filling the body to send a Webhook notification" +COM_TJNOTIFICATIONS_FIELD_WEBHOOK_USE_GLOBAL_URL_LABEL="Use Webhook URLs From Global Config" +COM_TJNOTIFICATIONS_FIELD_WEBHOOK_USE_GLOBAL_URL_DESC="Use the Webhook URls that are already defined in the global config. If you haven't added any URL in the global config then please do. If you don't wish to use global URLs then set this field value to 'No' and add custom URls by clicking 'Add Custom Webhook URLs'" +COM_TJNOTIFICATIONS_WEBHOOK_FIELDS="Webhook Fields" +COM_TJNOTIFICATIONS_WEBHOOK_FIELDS_DESC="Set webhook fields" +COM_TJNOTIFICATIONS_VIEW_NOTIFICATION_TAB_WEBHOOK="Webhook" +COM_TJNOTIFICATIONS_BACKEND_WEBHOOK="Webhook" +COM_TJNOTIFICATIONS_VIEW_NOTIFICATIONS_DEFAULT_WEBHOOK_TITLE="Webhook" +COM_TJNOTIFICATIONS_SETTINGS_ADD_WEBHOOK_URLS_LABEL="Add Webhook URLs" +COM_TJNOTIFICATIONS_SETTINGS_ADD_WEBHOOK_URLS_DESC="Specify all the Webhook URLs at the global level. Later you can also add Notification Template specific URLs." +COM_TJNOTIFICATIONS_SETTINGS_WEBHOOK_URL_LABEL="Webhook URL" +COM_TJNOTIFICATIONS_SETTINGS_WEBHOOK_URL_DESC="Enter URL for your Webhook notification" +COM_TJNOTIFICATIONS_TEMPLATE_ERR_MSG_CUSTOM_WEBHOOK_URLS="Please add custom webhook URL or use global webhook URL" +COM_TJNOTIFICATIONS_TEMPLATE_ERR_MSG_GLOBAL_WEBHOOK_URLS="Please add webhook URLs in the global config or add custom webhook URL." diff --git a/src/com_tjnotifications/admin/models/fields/backends.php b/src/com_tjnotifications/admin/models/fields/backends.php index 26194922..3b2e5a90 100644 --- a/src/com_tjnotifications/admin/models/fields/backends.php +++ b/src/com_tjnotifications/admin/models/fields/backends.php @@ -47,6 +47,7 @@ protected function getOptions() $options[] = HTMLHelper::_('select.option', 'push', Text::_('COM_TJNOTIFICATIONS_BACKEND_PUSH')); $options[] = HTMLHelper::_('select.option', 'sms', Text::_('COM_TJNOTIFICATIONS_BACKEND_SMS')); $options[] = HTMLHelper::_('select.option', 'whatsapp', Text::_('COM_TJNOTIFICATIONS_BACKEND_WHATSAPP')); + $options[] = HTMLHelper::_('select.option', 'webhook', Text::_('COM_TJNOTIFICATIONS_BACKEND_WEBHOOK')); return array_merge(parent::getOptions(), array_values($options)); } diff --git a/src/com_tjnotifications/admin/models/forms/global_config_webhookurl.xml b/src/com_tjnotifications/admin/models/forms/global_config_webhookurl.xml new file mode 100755 index 00000000..209cf9e1 --- /dev/null +++ b/src/com_tjnotifications/admin/models/forms/global_config_webhookurl.xml @@ -0,0 +1,14 @@ + +
+
+ +
+
diff --git a/src/com_tjnotifications/admin/models/forms/notification.xml b/src/com_tjnotifications/admin/models/forms/notification.xml index 35ad0195..97af38f7 100644 --- a/src/com_tjnotifications/admin/models/forms/notification.xml +++ b/src/com_tjnotifications/admin/models/forms/notification.xml @@ -195,6 +195,35 @@ + +
+ + + + + + +
+
+