Adding CC to contact form plugin I'm trying to edit the Contact Form plugin to copy the email to another address.

Looking in apps/models/EmailModel.php I see this for CC:

'cc' =&gt; array(AttributeType::Mixed);


Looking in apps/services/EmailService.php I see this:

// Add any CC's
if (!empty($emailModel-&gt;cc))
{
    foreach ($emailModel-&gt;cc as $cc)
    {
        if (!empty($cc['email']))
        {
            $ccEmail = $cc['email'];

            $ccName = !empty($cc['name']) ? $cc['name'] : '';
            $email-&gt;addCC($ccEmail, $ccName);
        }
    }
}


So, it looks like 'cc' needs to be array? I tried it without it being an array and I get an invalid foreach error. At the moment, I've added this line to ContactFormService.php (after line 45):

$email-&gt;cc = array('email' =&gt; 'name@domain.com');


I've also tried this:

$email-&gt;cc = array('email' =&gt; 'name@domain.com', 'name' =&gt; 'My Name');


The problem: The email is not being CC'd and I'm not getting any errors. Anyone?
From that code snippet, it looks like you're needing nested arrays. Try setting your $email-&gt;cc property like this.

$email-&gt;cc = array(
    array('name' =&gt; 'Your Name', 'email' =&gt; 'name@example.com')
);


The code snippet is iterating over $email-&gt;cc as $cc as the first array, then going into cc['name'] and cc['email'] as a nested array.