Plugin Directory

Changeset 1005131


Ignore:
Timestamp:
10/10/2014 01:57:29 PM (11 years ago)
Author:
ffischer
Message:

fix improper handling of string type headers

Location:
bcc-everything/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • bcc-everything/trunk/readme.txt

    r1001162 r1005131  
    88License URI: http://www.gnu.org/licenses/gpl-2.0.html
    99
    10 Automatically set Admin Bcc on every outgoing email. Useful for verifying that emails get sent correctly.
     10Blind copy (Bcc:) all outgoing emails to Admin. This can be used to verify the
     11correct sending of emails, or as a simple monitoring device.
    1112
    1213== Description ==
    1314
    14 This plugin automatically sets Admin Bcc on every outgoing email. This uses the main blog email address as defined in
    15 Settings -> General. There is nothing to configure in this plugin. Just activate and forget.
     15This plugin adds the primary blog email address as Bcc: recipient to every email
     16sent by WordPress. It uses the address defined in Settings -> General. There is
     17nothing to configure in this plugin. Just activate and forget.
    1618
    1719== Installation ==
     
    2224== Changelog ==
    2325
     26= 1.0.1 =
     27* fix: handling of string type headers
     28
    2429= 1.0 =
    2530* First version.
  • bcc-everything/trunk/wp-bcc-everything.php

    r1001162 r1005131  
    33 * Plugin Name: BCC Everything
    44 * Plugin URI: https://github.com/felixfischer/wp-bcc-everything
    5  * Description: Bcc all outgoing emails to Admin
    6  * Version: 1.0
     5 * Description: Blind copy (Bcc:) outgoing emails to Admin
     6 * Version: 1.0.1
    77 * Author: Felix Fischer
    88 * Author URI: http://felixfischer.com
     
    1010*/
    1111
    12 add_filter( 'wp_mail', 'bcc_everything' );
     12add_filter('wp_mail', 'bcc_everything');
    1313
    14 function bcc_everything( $args ) {
     14function bcc_everything($args) {
    1515  $email = get_settings('admin_email');
    16   $args['headers'][] = 'Bcc: '.$email;
     16  if (is_array($args['headers'])) {
     17    $args['headers'][] = 'Bcc: '.$email;
     18  }
     19  else {
     20    $args['headers'] .= 'Bcc: '.$email."\r\n";
     21  }
    1722  return $args;
    1823}
Note: See TracChangeset for help on using the changeset viewer.