Changeset 3483542
- Timestamp:
- 03/16/2026 07:52:11 AM (2 weeks ago)
- Location:
- yournotify
- Files:
-
- 37 added
- 3 edited
-
tags/2.1.7 (added)
-
tags/2.1.7/admin-settings-register.php (added)
-
tags/2.1.7/admin-settings-router.php (added)
-
tags/2.1.7/admin-settings-tabbed.php (added)
-
tags/2.1.7/admin-settings.php (added)
-
tags/2.1.7/assets (added)
-
tags/2.1.7/assets/banner-1544x500.jpg (added)
-
tags/2.1.7/assets/banner-772x250.jpg (added)
-
tags/2.1.7/assets/css (added)
-
tags/2.1.7/assets/css/main.css (added)
-
tags/2.1.7/assets/icon-128x128.png (added)
-
tags/2.1.7/assets/icon-256x256.png (added)
-
tags/2.1.7/assets/icon.svg (added)
-
tags/2.1.7/assets/js (added)
-
tags/2.1.7/assets/js/admin.js (added)
-
tags/2.1.7/assets/js/frontend.js (added)
-
tags/2.1.7/inc (added)
-
tags/2.1.7/inc/yournotify-subscribe.php (added)
-
tags/2.1.7/includes (added)
-
tags/2.1.7/includes/class-yournotify-api.php (added)
-
tags/2.1.7/includes/class-yournotify-automation.php (added)
-
tags/2.1.7/includes/class-yournotify-contact.php (added)
-
tags/2.1.7/includes/class-yournotify-drip.php (added)
-
tags/2.1.7/includes/class-yournotify-email.php (added)
-
tags/2.1.7/includes/class-yournotify-logs.php (added)
-
tags/2.1.7/includes/class-yournotify-mailer.php (added)
-
tags/2.1.7/includes/class-yournotify-optin.php (added)
-
tags/2.1.7/includes/class-yournotify-sms.php (added)
-
tags/2.1.7/includes/class-yournotify-smtp.php (added)
-
tags/2.1.7/includes/class-yournotify-subscription.php (added)
-
tags/2.1.7/includes/class-yournotify-templates.php (added)
-
tags/2.1.7/includes/class-yournotify-webhook.php (added)
-
tags/2.1.7/includes/class-yournotify-woocommerce.php (added)
-
tags/2.1.7/languages (added)
-
tags/2.1.7/languages/yournotify.pot (added)
-
tags/2.1.7/readme.txt (added)
-
tags/2.1.7/yournotify.php (added)
-
trunk/includes/class-yournotify-email.php (modified) (2 diffs)
-
trunk/readme.txt (modified) (2 diffs)
-
trunk/yournotify.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
yournotify/trunk/includes/class-yournotify-email.php
r3483496 r3483542 5 5 6 6 class Yournotify_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( 7 protected function smtp_enabled() { 8 return (bool) get_option('yournotify_smtp_enable'); 9 } 10 11 protected function normalize_recipients($to, $name = '', $attribs = array()) { 12 if (is_array($to)) { 13 $items = array(); 14 foreach ($to as $item) { 15 if (is_string($item)) { 16 $items[] = array('email' => $item, 'name' => '', 'attribs' => array()); 17 } elseif (is_array($item)) { 18 $items[] = array( 19 'email' => $item['email'] ?? '', 20 'name' => $item['name'] ?? '', 21 'attribs' => is_array($item['attribs'] ?? null) ? $item['attribs'] : array(), 22 ); 23 } 24 } 25 return $items; 26 } 27 return array(array( 10 28 'email' => $to, 11 29 'name' => $name, 12 30 'attribs' => is_array($attribs) ? $attribs : array(), 13 31 )); 32 } 33 34 protected function send_via_wp_mail($subject, $html, $text, array $recipients) { 35 $headers = array('Content-Type: text/html; charset=UTF-8'); 36 foreach ($recipients as $recipient) { 37 $email = sanitize_email($recipient['email'] ?? ''); 38 if (!$email) { 39 continue; 40 } 41 $body = $html ?: nl2br(esc_html($text)); 42 $sent = wp_mail($email, $subject, $body, $headers); 43 if (!$sent) { 44 error_log('Email sending failed via wp_mail for ' . $email); 45 return false; 46 } 47 } 48 return true; 49 } 50 51 public function send_email($title, $subject, $html, $text = '', $status = 'draft', $from = '', $to = null, $name = '', $attribs = array()) { 52 $from_email = $from ?: get_option('yournotify_from_email'); 53 $recipients = $this->normalize_recipients($to, $name, $attribs); 54 55 if ($this->smtp_enabled()) { 56 return $this->send_via_wp_mail($subject, $html, $text, $recipients); 57 } 14 58 15 59 $payload = array( … … 23 67 'status' => $status, 24 68 'channel' => 'email', 25 'lists' => $recipient ,69 'lists' => $recipients, 26 70 ); 27 71 -
yournotify/trunk/readme.txt
r3483496 r3483542 4 4 Requires at least: 4.6 5 5 Tested up to: 6.7 6 Stable tag: 2.1. 66 Stable tag: 2.1.7 7 7 License: GPLv3 or later 8 8 … … 66 66 == Changelog == 67 67 68 = 2.1.7 = 69 * Route plugin email sends through wp_mail() when SMTP override is enabled. 70 * Load helper classes explicitly from the plugin bootstrap. 71 72 68 73 = 2.1.6 = 69 74 * Normalize plugin API calls to the current Yournotify endpoints. -
yournotify/trunk/yournotify.php
r3483496 r3483542 4 4 * Plugin URI: https://yournotify.com 5 5 * Description: Yournotify WP Plugin — SMTP, Subscriber Form, Contact Form. 6 * Version: 2.1. 66 * Version: 2.1.7 7 7 * Author: Yournotify 8 8 * Author URI: https://yournotify.com … … 56 56 57 57 // Shortcode/handlers 58 require_once __DIR__ . '/includes/class-yournotify-api.php'; 58 59 require_once __DIR__ . '/includes/class-yournotify-optin.php'; 59 60 require_once __DIR__ . '/includes/class-yournotify-contact.php'; 60 require_once __DIR__ . '/includes/class-yournotify-api.php'; 61 require_once __DIR__ . '/includes/class-yournotify-email.php'; 62 require_once __DIR__ . '/includes/class-yournotify-sms.php'; 63 require_once __DIR__ . '/includes/class-yournotify-subscription.php'; 64 require_once __DIR__ . '/includes/class-yournotify-automation.php'; 65 require_once __DIR__ . '/includes/class-yournotify-drip.php'; 66 require_once __DIR__ . '/includes/class-yournotify-woocommerce.php'; 61 67 // Activation hook for DB tables 62 68 if (function_exists('register_activation_hook')) {
Note: See TracChangeset
for help on using the changeset viewer.