golden hour
/var/softaculous/sitepad/editor/site-data/plugins/gosmtp-pro/main/notifications
⬆️ Go Up
Upload
File/Folder
Size
Actions
discord.php
980 B
Del
OK
email.php
1.04 KB
Del
OK
manager.php
1.18 KB
Del
OK
pushover.php
1.19 KB
Del
OK
sender.php
1.15 KB
Del
OK
slack.php
988 B
Del
OK
webhook.php
826 B
Del
OK
Edit: webhook.php
<?php namespace GOSMTP\Notifications; use GOSMTP\Notifications\Manager; class Webhook extends Manager{ var $title = 'Webhook'; var $service = 'webhook'; public function send($message){ $webhook_url = $this->get_option('webhook_url', $this->service); if(empty($webhook_url)){ return false; }; $message = html_entity_decode($message, ENT_QUOTES, 'UTF-8'); $body = [ 'text' => $message ]; $headers = [ 'content-type' => 'application/json' ]; return wp_remote_post($webhook_url,[ 'body' => json_encode($body), 'headers' => $headers ]); } public function load_services_field(){ $fields = [ 'webhook_url' => [ 'title' => __('Webhook URL', 'gosmtp-pro'), 'type' => 'password', 'desc' => __('Enter your Webhook URL', 'gosmtp-pro') ] ]; return $fields; } }
Save