Plugin Directory

Changeset 3167112


Ignore:
Timestamp:
10/11/2024 11:07:55 AM (18 months ago)
Author:
roelv
Message:

Added screenshot, updated tested upto, bug fix

Location:
inesta-send-mail-copy
Files:
1 added
3 edited

Legend:

Unmodified
Added
Removed
  • inesta-send-mail-copy/trunk/in_wpmail_copy.php

    r1588242 r3167112  
    22/**
    33 * Plugin Name:     Inesta Send Mail Copy
    4  * Plugin URI:      https://inesta.nl
     4 * Plugin URI:      https://webapplicatielatenmaken.nl
    55 * Description:     Sends a copy or BCC of every e-mail send via WordPress to an e-mail address.
    66 * Author:          Inesta
    7  * Author URI:      https://inesta.nl
     7 * Author URI:      https://webapplicatielatenmaken.nl
    88 * Text Domain:     in_mc
    99 * Domain Path:     /languages
    10  * Version:         1.0.1
     10 * Version:         1.0.2
    1111 *
    1212 * @package         In_wpmail_copy
  • inesta-send-mail-copy/trunk/readme.txt

    r1588242 r3167112  
    44Tags: email, admin
    55Requires at least: 3.7
    6 Tested up to: 4.7
    7 Stable tag: 1.0.2
     6Tested up to: 6.6.2
     7Stable tag: 1.0.3
    88License: GPLv2 or later
    99License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    3636
    3737== Screenshots ==
     381. The settings page
    3839
    3940== Changelog ==
    4041
     42= 1.0.3 =
     43* Tested up to 6.6.2
     44* Fixed issue with BCC e-mail address
    4145
    4246= 1.0.2 =
  • inesta-send-mail-copy/trunk/src/Inesta/MailCopy/MailHandler.php

    r1588242 r3167112  
    66class MailHandler {
    77
    8     public static function update_recipients( $args ) {
     8    public static function update_recipients( $args ) {
     9        $options = get_option( 'in_mc_option_bcc' );
    910
    10         $options = get_option( 'in_mc_option_bcc' );
     11        if ( empty( $options ) || empty( $options['bcc'] ) ) {
     12            return $args;
     13        }
    1114
    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;
    1517
    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        }
    1822
    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            }
    2138
    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        }
    3541
    36             wp_mail( $email, $args['subject'], $args['message'], $args['headers'], $args['attachments'] );
    37 
    38         }
    39 
    40         return $args;
    41     }
     42        return $args;
     43    }
    4244
    4345    private static function check_string_contains_email( $string, $email ) {
Note: See TracChangeset for help on using the changeset viewer.