Changeset 3167112
- Timestamp:
- 10/11/2024 11:07:55 AM (18 months ago)
- Location:
- inesta-send-mail-copy
- Files:
-
- 1 added
- 3 edited
-
assets/screenshot-1.png (added)
-
trunk/in_wpmail_copy.php (modified) (1 diff)
-
trunk/readme.txt (modified) (2 diffs)
-
trunk/src/Inesta/MailCopy/MailHandler.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
inesta-send-mail-copy/trunk/in_wpmail_copy.php
r1588242 r3167112 2 2 /** 3 3 * Plugin Name: Inesta Send Mail Copy 4 * Plugin URI: https:// inesta.nl4 * Plugin URI: https://webapplicatielatenmaken.nl 5 5 * Description: Sends a copy or BCC of every e-mail send via WordPress to an e-mail address. 6 6 * Author: Inesta 7 * Author URI: https:// inesta.nl7 * Author URI: https://webapplicatielatenmaken.nl 8 8 * Text Domain: in_mc 9 9 * Domain Path: /languages 10 * Version: 1.0. 110 * Version: 1.0.2 11 11 * 12 12 * @package In_wpmail_copy -
inesta-send-mail-copy/trunk/readme.txt
r1588242 r3167112 4 4 Tags: email, admin 5 5 Requires at least: 3.7 6 Tested up to: 4.77 Stable tag: 1.0. 26 Tested up to: 6.6.2 7 Stable tag: 1.0.3 8 8 License: GPLv2 or later 9 9 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 36 36 37 37 == Screenshots == 38 1. The settings page 38 39 39 40 == Changelog == 40 41 42 = 1.0.3 = 43 * Tested up to 6.6.2 44 * Fixed issue with BCC e-mail address 41 45 42 46 = 1.0.2 = -
inesta-send-mail-copy/trunk/src/Inesta/MailCopy/MailHandler.php
r1588242 r3167112 6 6 class MailHandler { 7 7 8 public static function update_recipients( $args ) { 8 public static function update_recipients( $args ) { 9 $options = get_option( 'in_mc_option_bcc' ); 9 10 10 $options = get_option( 'in_mc_option_bcc' ); 11 if ( empty( $options ) || empty( $options['bcc'] ) ) { 12 return $args; 13 } 11 14 12 if ( empty( $options ) || empty( $options['bcc'] ) ) { 13 return $args; 14 } 15 $email = $options['bcc']; 16 $isBcc = ( isset( $options['bcc_use'] ) && $options['bcc_use'] == 1 ) ? true : false; 15 17 16 $email = $options['bcc']; 17 $isBcc = ( isset( $options['bcc_use'] ) && $options['bcc_use'] == 1 ) ? true : false; 18 // Controleer of 'headers' al een array is, anders maak je er een lege array van. 19 if ( !is_array( $args['headers'] ) ) { 20 $args['headers'] = []; 21 } 18 22 19 if ( $isBcc ) { 20 $args['headers'][] = 'BCC: ' . $email; 23 if ( $isBcc ) { 24 $args['headers'][] = 'BCC: ' . $email; 25 } else { 26 // Als het e-mailadres al in de 'to' zit, niet opnieuw toevoegen. 27 if ( is_array( $args['to'] ) ) { 28 foreach ( $args['to'] as $to ) { 29 if ( self::check_string_contains_email( $to, $email ) ) { 30 return $args; 31 } 32 } 33 } else { 34 if ( self::check_string_contains_email( $args['to'], $email ) ) { 35 return $args; 36 } 37 } 21 38 22 } else { 23 // if the email address is already in the to 24 if ( is_array( $args['to'] ) ) { 25 foreach ( $args['to'] as $to ) { 26 if ( self::check_string_contains_email( $to, $email ) ) { 27 return $args; 28 } 29 } 30 } else { 31 if ( self::check_string_contains_email( $args['to'], $email ) ) { 32 return $args; 33 } 34 } 39 wp_mail( $email, $args['subject'], $args['message'], $args['headers'], $args['attachments'] ); 40 } 35 41 36 wp_mail( $email, $args['subject'], $args['message'], $args['headers'], $args['attachments'] ); 37 38 } 39 40 return $args; 41 } 42 return $args; 43 } 42 44 43 45 private static function check_string_contains_email( $string, $email ) {
Note: See TracChangeset
for help on using the changeset viewer.