Adding headers to email templates

4 posts by 3 authors in: Forums > CMS Builder
Last Post: October 30, 2013   (RSS)

By pault - October 8, 2013

I would like to use the email template system to send emails but need to be able to Bcc each email to a specific address.

I've tried to set this up but can't get it to work, I've tried the following:

$emailHeaders = emailTemplate_loadFromDB(array(
              'template_id'  => 'USER-SIGNUP',
              'headers' => array(
                'Bcc'   => 'email@address.com',
              ),
              'placeholders' => array(
                'username'   => $_POST['email'],
            )));
            $mailErrors   = sendMessage($emailHeaders);

Please can you tell me if it's possible and if so, where I'm going wrong?

Thanks, Paul.

By ross - October 17, 2013

Hi Paul

Thanks for posting!

I see what you are aiming for and I think we can look at the code to make headers available.  What is it that triggers the emails being sent? It is a simple contact form on your site somewhere? What I am thinking of as an alternative would be to just setup a second sendMessage() call right after the first one. That way, you can send the second copy to another address.

Do you think that would work?

Let me know what you think. Thanks!

-----------------------------------------------------------
Cheers,
Ross Fairbairn - Consulting
consulting@interactivetools.com

Hire me! Save time by getting our experts to help with your project.
Template changes, advanced features, full integration, whatever you
need. Whether you need one hour or fifty, get it done fast with
Priority Consulting: http://www.interactivetools.com/consulting/

By Dave - October 30, 2013

Hi Paul,

I think you're close.  Can you try replacing 'Bcc' with 'BCC' in your original code.  I think it's might be a case-sensitivity issue.

Let me know if that works, thanks!

Dave Edis - Senior Developer
interactivetools.com