| Server IP : 162.214.67.83 / Your IP : 216.73.217.9 Web Server : Apache System : Linux dedi-13542965.clustter.com.br 5.14.0-687.20.1.el9_8.x86_64 #1 SMP PREEMPT_DYNAMIC Tue Jun 30 06:22:49 EDT 2026 x86_64 User : pjacortinas ( 1096) PHP Version : 8.3.32 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : ON Directory : /home/pjacortinas/www/wp-content/plugins/gosmtp-pro/main/notifications/ |
Upload File : |
<?php
namespace GOSMTP\Notifications;
use GOSMTP\Notifications\Manager;
class Pushover extends Manager{
var $title = 'Pushover';
var $service = 'pushover';
public function send($message){
$pushover_user_key = $this->get_option('pushover_user_key', $this->service);
$pushover_api_token = $this->get_option('pushover_api_token', $this->service);
if(empty($pushover_user_key) || empty($pushover_api_token)){
return false;
};
$message = html_entity_decode($message, ENT_QUOTES, 'UTF-8');
$body = [
'user' => $pushover_user_key,
'token' => $pushover_api_token,
'message' => $message
];
$args = [
'body' => $body
];
$pushover_api = 'https://api.pushover.net/1/messages.json';
return wp_remote_post($pushover_api, $args);
}
public function load_services_field(){
$fields = [
'pushover_user_key' => [
'title' => __('Pushover User key', 'gosmtp-pro'),
'type' => 'password',
'desc' => __('Enter your Pushover User Key', 'gosmtp-pro')
],
'pushover_api_token' => [
'title' => __('Pushover Api Token', 'gosmtp-pro'),
'type' => 'password',
'desc' => __('Enter your Pushover application token', 'gosmtp-pro')
]
];
return $fields;
}
}