Gossamer Forum
Home : Products : Gossamer Links : Development, Plugins and Globals :

Recommend IT BCC Solution?

Quote Reply
Recommend IT BCC Solution?
In this thread:


A question was asked about "a mod that would also send a bcc message to the website."

It was recommended that this line be added to recommend_it.cgi :

bcc => $CFG->{'admin_email'}

It didn't work and I could find no other responses to the question. So, here is what I came up with. Let me know if this is a good/bad idea:

1. In the recommend.html template add this line to the form:

<input type="hidden" name="bcc_email" value="you@yourdomain.com">

2. Open recommend_it.cgi and add the line in bold:

GT::Mail->send (
smtp => $CFG->{db_smtp_server},
sendmail => $CFG->{db_mail_path},
to => $IN->param($recipemail),
from => $IN->param('send_email'),
subject => $subject_line,
reply => $IN->param('send_email'),
bcc => $IN->param(bcc_email),
msg => $formatted_message,
debug => $Links::DEBUG
) or Links::fatal ("Unable to send mail: $GT::Mail::error");

That's it. I tested it and everything seems to work.

I've learned so much visiting this board and I'm hoping this isn't a bad idea so I can finally say I was able to give something back by answering a question. Smile

...waiting for my bubble to be burst...
Quote Reply
Re: [3robert3] Recommend IT BCC Solution? In reply to

I *think* that db_admin_email is the field you want rather than admin_email for the first solution to work.

What you've done is fine - but you are giving away the fact that you're getting a copy of the email on the form page which you might not want to do (and I think that you should put bcc_email in quotes - param('bcc_email') - I keep getting told off for thisWink)

The UK High Street
Quote Reply
Re: [afinlr] Recommend IT BCC Solution? In reply to
Hi Laura,

I just tested the original solution with:

bcc => $CFG->{'db_admin_email'},

...and it works perfectly! You are right, this is better because it doesn't give away the fact that a bcc is being sent.

Thanks for your help!