Email Form Plugin - CC in Custom Headers

Hello,
I have a form with the email plugin. From address is the global Joomla address, To is set to a Fabrik placeholder. I'd like to be able to add a specific CC'd address rather than multiple addresses in the To field.

The site uses SendGrid for mail.

I've tried the following code in the Custom Headers section of the plugin:

return array('CC' => 'email@domain.com');

I receive the email at the "To" address and the CC'd address is shown properly in the CC field of the message. But, I never receive the email at the CC'd address.

Possibly helpful info... SendGrid activity shows the following...

- A message that is sent with only the placeholder in the To field, no CC'd header shows the Subject and From address in the log
- A message that is sent with the To placeholder and the CC'd header doesn't show the Subject or From address in the log

Is my Custom Header code formatted correctly?

Any thoughts on what might be happening or where to start looking?

Thanks!
 
You can have multiple email form plugins in a single form. But it might not do everything you want.

Matt
 
Hi Matt, Thanks for the response. I appreciate the help. I'm not sure multiple email plugins will do what I want though. I just need to add a CC'd email address to the existing email that's sent.
 
Ok. I'm still unsure why adding the CC header to the Custom Headers field doesn't work, but after some poking around the email plugin I solved this for our needs by adding a CC and BCC field. Both fields work with a single address, but do not work with a comma separated list nor with placeholders. This is sufficient for what we need it for, but might not work for everyone. Is this something worth submitting a PR for?
 
Using the custom fields won't work because the recipients have to be specifically given to the J! sendmail() function as an arg ...

$mail->sendmail($to, ...)

... which can be an array of emails or a single email string. We build the $to array from the "email to" settings.

The custom headers are injected directly into the envelope, so J!'s send is never aware of them as recipient emails.

Functionally, there is no difference between multiple addresses in the To field ...

to: hugh@test.test, {table___element}

... and ...

to: {table___element}
cc: hugh@test.test

... they both send to both recipients.

Although a BCC is significant.

Feel free to submit a PR, if it's not too much work I'll add the multiple recipient and placeholder handling.

Just make sure you code against the latest github, so there's no issue with conflicts.

-- hugh
 
I solved this a while ago with this Github update : Fabrik/fabrik/pull/2183
However after each update it must be performed again.

Jules
 
We are in need of some funding.
More details.

Thank you.

Staff online

Members online

Back
Top