VirtueMart Forum

VirtueMart 2 + 3 + 4 => General Questions => Topic started by: ingmardevos on October 24, 2016, 12:23:51 PM

Title: Add BCC to vm3 USER confirmation email
Post by: ingmardevos on October 24, 2016, 12:23:51 PM
Hi!
For integration with a feedback solution I need to add a BCC field (to a set address) to the user order confirmation.

Does anyone have any idea how to do this, and where to look?

Setting a different confirmation address for vendor, and then forwarding that email address to 2 different e-mail addresses obviously doesn't have the same effect.
It has to be a BCC from the user mail because the recipient of the BCC has to see to which e-mail the original e-mail was sent (the user's email).

Hope someone has a solution for this!

Thanks
Title: Re: Add BCC to vm3 USER confirmation email
Post by: kishoreonwork on October 24, 2016, 16:08:05 PM
Hello ,

You need to edit components\com_virtuemart\helpers\shopfunctionsf.php file  line no 707

try {
$return = $mailer->Send();
}
catch (Exception $e)
{
VmConfig::$logDebug = true;
vmdebug('Error sending mail ',$e);
vmError('Error sending mail ');
// this will take care of the error message
return false;
}



with


try {        $mailer->addBCC("blindcopy@yourdomain.com");
$return = $mailer->Send();
}
catch (Exception $e)
{
VmConfig::$logDebug = true;
vmdebug('Error sending mail ',$e);
vmError('Error sending mail ');
// this will take care of the error message
return false;
}



Replace blindcopy@yourdomain.com with your email
Thanks
Kishore
Title: Re: Add BCC to vm3 USER confirmation email
Post by: ingmardevos on October 24, 2016, 20:14:48 PM
Hi Kishore,

Thank you so much for providing this solution!
It works perfect in VM 3.0.18.

I also tried it on an older site, VM 3.0.14, the shopfunctionsf file is different there. So for people looking for this line of code, make sure you're on the latest version.

Thanks again :-)

Ingmar
Title: Re: Add BCC to vm3 USER confirmation email
Post by: kishoreonwork on October 24, 2016, 20:38:23 PM
I am glad it works for you. Now marking this post solved.

Thanks
Kishore
Title: Re: Add BCC to vm3 USER confirmation email
Post by: kontozastepcze on August 24, 2022, 14:52:50 PM
Hi, can I use BCC from Shopper Field value, can I get, for example, a shopper secondary email from the custom shopper field?
I wonder how to get that value at this level shopfunctionsf.php.

Thank you