Changeset 3483496
- Timestamp:
- 03/16/2026 07:18:36 AM (2 weeks ago)
- Location:
- yournotify
- Files:
-
- 38 added
- 8 edited
-
tags/2.1.6 (added)
-
tags/2.1.6/admin-settings-register.php (added)
-
tags/2.1.6/admin-settings-router.php (added)
-
tags/2.1.6/admin-settings-tabbed.php (added)
-
tags/2.1.6/admin-settings.php (added)
-
tags/2.1.6/assets (added)
-
tags/2.1.6/assets/banner-1544x500.jpg (added)
-
tags/2.1.6/assets/banner-772x250.jpg (added)
-
tags/2.1.6/assets/css (added)
-
tags/2.1.6/assets/css/main.css (added)
-
tags/2.1.6/assets/icon-128x128.png (added)
-
tags/2.1.6/assets/icon-256x256.png (added)
-
tags/2.1.6/assets/icon.svg (added)
-
tags/2.1.6/assets/js (added)
-
tags/2.1.6/assets/js/admin.js (added)
-
tags/2.1.6/assets/js/frontend.js (added)
-
tags/2.1.6/inc (added)
-
tags/2.1.6/inc/yournotify-subscribe.php (added)
-
tags/2.1.6/includes (added)
-
tags/2.1.6/includes/class-yournotify-api.php (added)
-
tags/2.1.6/includes/class-yournotify-automation.php (added)
-
tags/2.1.6/includes/class-yournotify-contact.php (added)
-
tags/2.1.6/includes/class-yournotify-drip.php (added)
-
tags/2.1.6/includes/class-yournotify-email.php (added)
-
tags/2.1.6/includes/class-yournotify-logs.php (added)
-
tags/2.1.6/includes/class-yournotify-mailer.php (added)
-
tags/2.1.6/includes/class-yournotify-optin.php (added)
-
tags/2.1.6/includes/class-yournotify-sms.php (added)
-
tags/2.1.6/includes/class-yournotify-smtp.php (added)
-
tags/2.1.6/includes/class-yournotify-subscription.php (added)
-
tags/2.1.6/includes/class-yournotify-templates.php (added)
-
tags/2.1.6/includes/class-yournotify-webhook.php (added)
-
tags/2.1.6/includes/class-yournotify-woocommerce.php (added)
-
tags/2.1.6/languages (added)
-
tags/2.1.6/languages/yournotify.pot (added)
-
tags/2.1.6/readme.txt (added)
-
tags/2.1.6/yournotify.php (added)
-
trunk/admin-settings.php (modified) (1 diff)
-
trunk/inc/yournotify-subscribe.php (modified) (1 diff)
-
trunk/includes/class-yournotify-api.php (added)
-
trunk/includes/class-yournotify-automation.php (modified) (1 diff)
-
trunk/includes/class-yournotify-email.php (modified) (1 diff)
-
trunk/includes/class-yournotify-sms.php (modified) (1 diff)
-
trunk/includes/class-yournotify-subscription.php (modified) (1 diff)
-
trunk/readme.txt (modified) (2 diffs)
-
trunk/yournotify.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
yournotify/trunk/admin-settings.php
r3376881 r3483496 123 123 } 124 124 125 $lists = $body['data']['results'];125 $lists = isset($body['data']['results']) && is_array($body['data']['results']) ? $body['data']['results'] : (is_array($body['data']) ? $body['data'] : array()); 126 126 $selected_list_id = get_option('yournotify_list_id'); 127 127 ?> -
yournotify/trunk/inc/yournotify-subscribe.php
r2892073 r3483496 162 162 $args = array( 163 163 'headers' => array( 164 ' x-access-token' => sprintf( '%1$s', $api_key ),164 'Authorization' => 'Bearer ' . $api_key, 165 165 ), 166 166 ); -
yournotify/trunk/includes/class-yournotify-automation.php
r3242205 r3483496 87 87 if ($current_step['type'] === 'email') { 88 88 $email = new Yournotify_Email(); 89 $email->send_email($current_step['to'], $current_step['subject'], $current_step['message']); 89 $email->send_email( 90 $current_step['name'] ?? $current_step['subject'] ?? 'Automation Email', 91 $current_step['subject'] ?? 'Automation Email', 92 $current_step['html'] ?? wpautop($current_step['message'] ?? ''), 93 $current_step['text'] ?? ($current_step['message'] ?? ''), 94 $current_step['status'] ?? 'running', 95 get_option('yournotify_from_email'), 96 $current_step['to'] ?? '', 97 $current_step['recipient_name'] ?? '', 98 $current_step['attribs'] ?? array() 99 ); 90 100 } elseif ($current_step['type'] === 'sms') { 91 101 $sms = new Yournotify_SMS(); 92 $sms->send_sms($current_step['to'], $current_step['message']); 102 $sms->send_sms( 103 $current_step['name'] ?? $current_step['subject'] ?? 'Automation SMS', 104 $current_step['subject'] ?? '', 105 $current_step['message'] ?? '', 106 $current_step['status'] ?? 'running', 107 get_option('yournotify_from_sender_id'), 108 $current_step['to'] ?? '', 109 $current_step['recipient_name'] ?? '', 110 $current_step['attribs'] ?? array() 111 ); 93 112 } 94 113 -
yournotify/trunk/includes/class-yournotify-email.php
r3242205 r3483496 1 1 <?php 2 2 if (!defined('ABSPATH')) { 3 exit; // Exit if accessed directly.3 exit; 4 4 } 5 5 6 6 class Yournotify_Email { 7 public function send_email($title, $subject, $html, $text, $status, $to, $name, $attribs) { 8 $api_key = get_option('yournotify_api_key'); 9 $from_email = get_option('yournotify_from_email'); 7 public function send_email($title, $subject, $html, $text = '', $status = 'draft', $from = '', $to = null, $name = '', $attribs = array()) { 8 $from_email = $from ?: get_option('yournotify_from_email'); 9 $recipient = is_array($to) ? $to : array(array( 10 'email' => $to, 11 'name' => $name, 12 'attribs' => is_array($attribs) ? $attribs : array(), 13 )); 10 14 11 $body = array( 12 'name' => $title, 13 'subject' => $subject, 14 'html' => $html, 15 'text' => $text, 16 'from' => $from_email, 17 'status' => $status, 18 'channel' => "email", 19 'lists' => array( 20 (object)[ 21 "email" => $to, 22 "name" => $name, 23 "attribs" => $attribs, 24 ] 25 ), 15 $payload = array( 16 'name' => $title, 17 'subject' => $subject, 18 'html' => $html, 19 'body' => $html, 20 'text' => $text, 21 'from' => $from_email, 22 'from_email' => $from_email, 23 'status' => $status, 24 'channel' => 'email', 25 'lists' => $recipient, 26 26 ); 27 27 28 $response = wp_remote_post('https://api.yournotify.com/send-email', array( 29 'method' => 'POST', 30 'headers' => array( 31 'Authorization' => 'Bearer ' . $api_key, 32 'Content-Type' => 'application/json' 33 ), 34 'body' => json_encode($body) 35 )); 36 28 $response = Yournotify_API::request('campaigns/email', 'POST', $payload); 37 29 if (is_wp_error($response)) { 38 30 error_log('Email sending failed: ' . $response->get_error_message()); 39 31 return false; 40 32 } 41 42 $body = json_decode(wp_remote_retrieve_body($response), true); 43 if (isset($body['success']) && $body['success']) { 33 if (Yournotify_API::is_success($response)) { 44 34 return true; 45 } else {46 error_log('Email sending failed: ' . wp_remote_retrieve_body($response));47 return false;48 35 } 36 error_log('Email sending failed: ' . wp_json_encode($response)); 37 return false; 49 38 } 50 39 } -
yournotify/trunk/includes/class-yournotify-sms.php
r3242205 r3483496 1 1 <?php 2 2 if (!defined('ABSPATH')) { 3 exit; // Exit if accessed directly.3 exit; 4 4 } 5 5 6 6 class Yournotify_SMS { 7 public function send_sms($title, $subject, $text, $status, $to, $name, $attribs) { 8 $api_key = get_option('yournotify_api_key'); 9 $from_sender_id = get_option('yournotify_from_sender_id'); 7 public function send_sms($title, $subject = '', $text = '', $status = 'draft', $from = '', $to = null, $name = '', $attribs = array()) { 8 $sender = $from ?: get_option('yournotify_from_sender_id'); 9 $recipient = is_array($to) ? $to : array(array( 10 'telephone' => $to, 11 'name' => $name, 12 'attribs' => is_array($attribs) ? $attribs : array(), 13 )); 10 14 11 $ body= array(12 'name' => $title,15 $payload = array( 16 'name' => $title, 13 17 'subject' => $subject, 14 'text' => $text, 15 'from' => $from_sender_id, 16 'status' => $status, 17 'channel' => "sms", 18 'lists' => array( 19 (object)[ 20 "telephone" => $to, 21 "name" => $name, 22 "attribs" => $attribs, 23 ] 24 ), 18 'text' => $text, 19 'body' => $text, 20 'from' => $sender, 21 'sender' => $sender, 22 'status' => $status, 23 'channel' => 'sms', 24 'lists' => $recipient, 25 25 ); 26 26 27 $response = wp_remote_post('https://api.yournotify.com/send-sms', array( 28 'method' => 'POST', 29 'headers' => array( 30 'Authorization' => 'Bearer ' . $api_key, 31 'Content-Type' => 'application/json' 32 ), 33 'body' => json_encode($body) 34 )); 35 27 $response = Yournotify_API::request('campaigns/sms', 'POST', $payload); 36 28 if (is_wp_error($response)) { 37 29 error_log('SMS sending failed: ' . $response->get_error_message()); 38 30 return false; 39 31 } 40 41 $body = json_decode(wp_remote_retrieve_body($response), true); 42 if (isset($body['success']) && $body['success']) { 32 if (Yournotify_API::is_success($response)) { 43 33 return true; 44 } else {45 error_log('SMS sending failed: ' . wp_remote_retrieve_body($response));46 return false;47 34 } 35 error_log('SMS sending failed: ' . wp_json_encode($response)); 36 return false; 48 37 } 49 38 } -
yournotify/trunk/includes/class-yournotify-subscription.php
r3242205 r3483496 1 1 <?php 2 2 if (!defined('ABSPATH')) { 3 exit; // Exit if accessed directly.3 exit; 4 4 } 5 5 6 6 class Yournotify_Subscription { 7 7 public function add_contact($name, $email, $telephone, $selected_list_id = null) { 8 $api_key = get_option('yournotify_api_key');9 8 if (is_null($selected_list_id)) { 10 9 $selected_list_id = get_option('yournotify_list_id'); 11 10 } 12 11 13 $ body= array(14 'name' => $name,15 'email' => $email,12 $payload = array( 13 'name' => $name, 14 'email' => $email, 16 15 'telephone' => $telephone, 17 'lists' => array($selected_list_id)16 'lists' => $selected_list_id ? array($selected_list_id) : array(), 18 17 ); 19 18 20 $response = wp_remote_post('https://api.yournotify.com/contacts', array( 21 'method' => 'POST', 22 'headers' => array( 23 'Authorization' => 'Bearer ' . $api_key, 24 'Content-Type' => 'application/json' 25 ), 26 'body' => json_encode($body) 27 )); 28 19 $response = Yournotify_API::request('contacts', 'POST', $payload); 29 20 if (is_wp_error($response)) { 30 21 error_log('Subscription failed: ' . $response->get_error_message()); 31 22 return false; 32 23 } 33 34 $body = json_decode(wp_remote_retrieve_body($response), true); 35 if (isset($body['status']) && $body['status'] === "success") { 24 if (Yournotify_API::is_success($response)) { 36 25 return true; 37 } else {38 error_log('Subscription failed: ' . wp_remote_retrieve_body($response));39 return false;40 26 } 27 error_log('Subscription failed: ' . wp_json_encode($response)); 28 return false; 41 29 } 42 30 } -
yournotify/trunk/readme.txt
r3383620 r3483496 4 4 Requires at least: 4.6 5 5 Tested up to: 6.7 6 Stable tag: 2.1. 56 Stable tag: 2.1.6 7 7 License: GPLv3 or later 8 8 … … 66 66 == Changelog == 67 67 68 = 2.1.6 = 69 * Normalize plugin API calls to the current Yournotify endpoints. 70 * Add shared API client for bearer API-key requests. 71 * Fix automation/email/SMS helper compatibility with the current API surface. 72 73 68 74 *Release Date - 23 May 2022* 69 75 -
yournotify/trunk/yournotify.php
r3383620 r3483496 4 4 * Plugin URI: https://yournotify.com 5 5 * Description: Yournotify WP Plugin — SMTP, Subscriber Form, Contact Form. 6 * Version: 2.1. 56 * Version: 2.1.6 7 7 * Author: Yournotify 8 8 * Author URI: https://yournotify.com … … 58 58 require_once __DIR__ . '/includes/class-yournotify-optin.php'; 59 59 require_once __DIR__ . '/includes/class-yournotify-contact.php'; 60 require_once __DIR__ . '/includes/class-yournotify-api.php'; 60 61 // Activation hook for DB tables 61 62 if (function_exists('register_activation_hook')) {
Note: See TracChangeset
for help on using the changeset viewer.