• Hi,

    it would be nice to have BCC added to the settings.

    In fact I already did, but it would be cool to have it added to the official plugin.

    I added to class-easywpsmtp-admin.php, line ~250 (after reply-to):

    
    <tr valign="top">
    	<th scope="row"><?php esc_html_e( 'BCC Email Address', 'easy-wp-smtp' ); ?></th>
    	<td>
    		<input id="swpsmtp_bcc_email" type="email" name="swpsmtp_bcc_email" value="<?php echo isset( $swpsmtp_options['bcc_email'] ) ? esc_attr( $swpsmtp_options['bcc_email'] ) : ''; ?>" /><br />
    		<p class="description"><?php esc_html_e( "Optional. This email address will be used in the 'BCC' field of the email. You may define multiple addresses comma separated.", 'easy-wp-smtp' ); ?></p>
    	</td>
    </tr>
    

    and

    
    if ( isset( $_POST['swpsmtp_bcc_email'] ) ) {
    	$swpsmtp_options['bcc_email'] = sanitize_email( $_POST['swpsmtp_bcc_email'] );
    }
    

    in line 111.

    and to easy-wp-smtp.php

    
    if ( ! empty( $this->opts['bcc_email'] ) ) {
    	$mail->AddBcc( $this->opts['bcc_email'] );
    }
    

    in lines ~100 and ~220.

    Would be happy to see it in another update.

    Thanks!
    Markus

    • This topic was modified 4 years, 12 months ago by markuzzi.
Viewing 4 replies - 1 through 4 (of 4 total)
  • Thank you for sharing your solution with us. I have submitted a message to the developers to investigate further your code.

    Thank you

    Thread Starter markuzzi

    (@markuzzi)

    Update for multiple emails:

    
    if ( isset( $_POST['swpsmtp_bcc_email'] ) ) {
    	$emails = explode(",", $_POST['swpsmtp_bcc_email']);
    	foreach ($emails as $key => $email) {
    		$emails[$key] = sanitize_email( $email );
    	}
    	$swpsmtp_options['bcc_email'] = join(",", $emails);
    }
    

    and
    <input id="swpsmtp_bcc_email" type="text" name="swpsmtp_bcc_email" ...

    Thanks

    Thread Starter markuzzi

    (@markuzzi)

    and in easy-wp-smtp.php

    
    $emails = explode(",", $this->opts['bcc_email']);
    foreach ($emails as $key => $email) {
    	$phpmailer->AddBcc( $email );
    }
    

    and $mail->AddBcc( $email ); for test_mail.

    Sorry for dripping code…

    Hi.

    For code-related stuff, github suits better. Official repo for Easy WP SMTP plugin is here: https://github.com/Arsenal21/easy-wp-smtp

    Please clone it, make the changes and make a pull request.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Add BCC to settings’ is closed to new replies.