WordPress.org

Ready to get started?Download WordPress

Forums

SpeakUp! Email Petitions
[resolved] CC and BCC option? (8 posts)

  1. aslanj
    Member
    Posted 1 year ago #

    Hello!

    I recently installed this plugin and I love it! I was wondering whether you are considering adding CC and BCC options or not? Or is there a way I can add them?

    Thank you!

    http://wordpress.org/extend/plugins/speakup-email-petitions/

  2. Kreg Wallace
    Member
    Plugin Author

    Posted 1 year ago #

    I'm not planning to add this, but if you want to try adding it yourself, open up /includes/class.mail.php and add the CC or BCC values onto the $headers variable in the send_petition() function.

    A guide on how to compose the headers can be found here.

  3. aslanj
    Member
    Posted 1 year ago #

    Thank you so much, Kreg, for your quick reply. I will try and add it, and just in case anyone would like to do so, as well, I'll post the code here.

    I have another question, but I'll create a new topic so that I don't mess the support forum up.

    Thanks again!

  4. earthsite
    Member
    Posted 1 year ago #

    I've checked the code (/includes/class.mail.php) for adding a CC and BCC option, but it's a bit over my head.

    Is it easier to just change the default mode to use BCC (rather than customization options)? Could you provide me with the specific code to make this change?

    Thanks so much, this is a great plugin!

  5. Kreg Wallace
    Member
    Plugin Author

    Posted 1 year ago #

    I haven't actually tried this, so it's untested but to BCC yourself on the emails you would just need to add the BCC info to the email headers. In class.mail.php the headers for the confirmation email are set on line 38. To add a BCC header, you would add a new line there so that this:

    $headers = "From: " . $options['confirm_email'] . "\r\n";

    is changed to this:

    $headers = "From: " . $options['confirm_email'] . "\r\n";
    $headers .= 'Bcc: myname@domain.com' . "\r\n";

    of course you'll need to change myname@domain.com to your own email address. If you want to CC instead of BCC, then just replace the Bcc in the code above with Cc.

    A similar operation to line 75 would get you BCC'd on the petition message emails.

  6. earthsite
    Member
    Posted 1 year ago #

    Kreg,

    Thanks for the quick reply!

    I actually need something a little simpler... I need the default "target email" to be set to "BCC:" all addresses by default rather than the "TO:" default setup of all addresses being visible to the recipients.

    Can you give me a tip on how to make this change?

  7. earthsite
    Member
    Posted 1 year ago #

    Kreg,

    I'm hoping you can respond to my latest message... I made a donation :)

    I actually need something a little simpler... I need the default "target email" to be set as "BCC:" all addresses by default rather than the "TO:" default setup of all addresses being visible to the recipients.

    Thanks!

  8. earthsite
    Member
    Posted 1 year ago #

    Ok, I found out an imperfect solution.

    I added a BCC header and inserted my list of emails into the PHP code there.

    I had to leave a target email in order for it to save. Ideally, it could be set to use BCC without a target email (TO:), but this solution works.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic