Skip to main content

email confirmation: to the client/ us with BCC

More
12 years 10 months ago #131243 by aspkiddy
-- HikaShop version -- : 2.2.1 Hikashop Business
-- Joomla version -- : 2.5.11
-- PHP version -- : 5.4.5

--- email confirmation: to the client/ us with BCC (blind carbon copy)
Hi,
We receive a summary (notification) by "order admin notification" by email but I would like also receive a copy (of same email confirmation) which our customer receive by 'order cration notification' (menu System->Emails).
How I can ? :blush:


I tried :
I added following code in 'order creation notification' but it did not work : :ohmy:
Code:
<?php $data->customer->user_email = array($data->customer->user_email,'myemail@gmail.com'); ?>
I tried also following code in order.php (\administrator\components\com_hikashop\classes) but it did not work : :ohmy:
Code:
if(!empty($user_email)) { $order->customer->user_email = $user_email; $order->customer->name = $user_name; /* my new code */ $bcc="myemail@gmail.com"; $mail->$mailer->addBCC($bcc); /* END of my new code */
Thanks very much in advance! :)

Please Log in or Create an account to join the conversation.

More
12 years 10 months ago #131279 by Xavier
Hi,

In the email, you have to add the address in the var:
Code:
$data->mail->dst_email .= ', your_email@gmail.com';

Please Log in or Create an account to join the conversation.

More
12 years 10 months ago - 12 years 10 months ago #131381 by aspkiddy
Hi Xavier,

Thanks for your help.

I added your code in get function (function get($name,&$data){) in (\administrator\components\com_hikashop\classes/order.php)
Code:
function get($name,&$data){ $mail = new stdClass(); $mail->mail_name = $name; $this->loadInfos($mail,$name); $mail->body = $this->loadEmail($mail,$data); $mail->altbody = $this->loadEmail($mail,$data,'text'); $mail->data =& $data;
I added this one :
Code:
$data->mail->dst_email .= ', my_second_email@gmail.com'; /* new code by Xavier */
Code:
if($data!==true) $mail->body= hikashop_absoluteURL($mail->body); //...

I received a copy of notification [summary ] by "order admin notification"] in my 2nd email but no same email confirmation whom sent to customer.

I need receive a copy of same email confirmation whom sent to customer :(order cration notification) :blush:
Last edit: 12 years 10 months ago by aspkiddy. Reason: corection

Please Log in or Create an account to join the conversation.

More
12 years 10 months ago #131412 by Xavier
Hi,

Sorry I did not say that you have to add this code at the end of the "order creation notification" email.
Just add this code between php tags.

Please Log in or Create an account to join the conversation.

More
12 years 10 months ago #131514 by aspkiddy
Hi Xavier,

I went to the Email section (hikaShop) :

System >>> Emails
and then
I opened "Order creation notification" (ORDER_CREATION_NOTIFICATION)

I added your code but it did not work :(
Code:
<?php /** * @package HikaShop for Joomla! * @version 2.1.1 * @author hikashop.com * @copyright (C) 2010-2012 HIKARI SOFTWARE. All rights reserved. * @license GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html */ defined('_JEXEC') or die('Restricted access'); $data->mail->dst_email .= ', aspkiddy@hotmail.com'; // here I added your code!!!! here I added your code!!!! ?> <div style="background-color: #ffffff; font-family: Verdana, Arial, Helvetica, sans-serif;font-size:12px; color: #000000; width: 100%;"> <table style="margin: auto;font-family: Verdana, Arial, Helvetica, sans-serif;font-size:12px;" border="0" cellspacing="0" cellpadding="0"> <tbody> <tr> <td height="10"> </td> </tr> <tr> <td> <?php echo JText::sprintf('HI_CUSTOMER',@$data->customer->name);?> <br/> <br/> <?php $colspan = 4; $url = $data->order_number; $config =& hikashop_config(); if($config->get('simplified_registration',0)!=2){ $url = '<a href="'.$data->order_url.'">'. $url.'</a>'; } echo JText::sprintf('ORDER_CREATION_SUCCESS_ON_WEBSITE_AT_DATE',$url,HIKASHOP_LIVE, hikashop_getDate(time(),'%d %B %Y'), hikashop_getDate(time(),'%H:%M'));?> </td> </tr> <tr> <td height="10"> //... etc

Please Log in or Create an account to join the conversation.

More
12 years 10 months ago #131537 by nicolas
You should do like that:
$data->mail->dst_email .= ',aspkiddy@hotmail.com';

so without the space between the comma and the email address.

Please Log in or Create an account to join the conversation.

More
12 years 10 months ago #131546 by aspkiddy
Hi Nicolas,
I understand you
I must add following code :
Code:
$data->mail->dst_email .= ', aspkiddy@hotmail.com';

But I ask if I must add in email :

Hikashop >>> System >>> Emails
and then >>>"Order creation notification" (ORDER_CREATION_NOTIFICATION)

like this :
Code:
defined('_JEXEC') or die('Restricted access'); $data->mail->dst_email .= ', aspkiddy@hotmail.com'; ?>

Like this, It does not work :blush:

Please Log in or Create an account to join the conversation.

More
12 years 10 months ago - 12 years 10 months ago #131584 by nicolas
No you should do like that:
Code:
defined('_JEXEC') or die('Restricted access'); $data->mail->dst_email .= ',aspkiddy@hotmail.com'; ?>
Last edit: 12 years 10 months ago by Jerome.

Please Log in or Create an account to join the conversation.

More
12 years 10 months ago #132131 by aspkiddy

nicolas wrote: No you should do like that:
defined('_JEXEC') or die('Restricted access');
$data->mail->dst_email .= ',aspkiddy@hotmail.com';
?>

Like this, It does not work.
:ohmy:
Code:
$data->mail->dst_email .= ', aspkiddy@hotmail.com';

Please Log in or Create an account to join the conversation.

More
12 years 10 months ago #132152 by Jerome
Hi,

There is no space between the coma and the email address.

Regards,

Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.

Please Log in or Create an account to join the conversation.

More
12 years 10 months ago #132324 by aspkiddy
Hi Jerome,

I tried two times :(
1st time, like this : (no space between the coma and the email address)
Code:
defined('_JEXEC') or die('Restricted access'); $data->mail->dst_email .= ',aspkiddy@hotmail.com'; ?>
but I didn't work :oops:
and 2nd time : (no space between the point and dst_mail and no space between the coma and the email address
Code:
defined('_JEXEC') or die('Restricted access'); $data->mail->dst_email.= ',aspkiddy@hotmail.com'; ?>
but I didn't work :oops: :blush:

Please Log in or Create an account to join the conversation.

More
12 years 10 months ago #132530 by Xavier
Hi,

Sorry this seems to have a little bit changed.
Thanks to use:
Code:
$data->customer->user_email .= ',aspkiddy@hotmail.com';

Please Log in or Create an account to join the conversation.

More
12 years 10 months ago #132595 by aspkiddy

Xavier wrote: Hi,

Code:
$data->customer->user_email .= ',aspkiddy@hotmail.com';


Hi Xavier,

It works your code thanks :) but it isn't BBC (blind carbon copy), It is Cc : :blush:

To: client_customer_email@gmail.com, aspkiddy@hotmail.com


how can I put my email adress by BBC ? :huh:

Please Log in or Create an account to join the conversation.

More
12 years 10 months ago - 12 years 10 months ago #132698 by Jerome
Hi,

Well, I guess you can access to the Joomla mailer object
Code:
$this->mailer
So
Code:
$this->mailer->addBCC( $address );
Regarding : api.joomla.fr/jplatform/classPHPMailer.h...db5329912a5ffc9bffdd

Regards,

Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.
Last edit: 12 years 10 months ago by Jerome.

Please Log in or Create an account to join the conversation.

More
12 years 10 months ago #132888 by aspkiddy
Hi Jerome,

I'm confused, :blink:

Where I must add this code ?
In Email (I added : System >>> Emails) ?
Code:
$address= 'aspkiddy@hotmail.com'; $this->mail->addBCC($address);
or
Code:
$this->mail->addBCC('aspkiddy@hotmail.com');

Like this, It does not work :oops: :blush:

Please Log in or Create an account to join the conversation.

More
12 years 10 months ago - 12 years 10 months ago #132918 by Jerome
Hi,

My fault, I wrote it wrong in the second "code" block.
The mailer object is $this->mailer.
$this->mail is the mail that we want to send.
So you have to use:
Code:
$this->mailer->addBCC( $address );
In the email yes, it's good.
Regards,

Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.
Last edit: 12 years 10 months ago by Jerome.

Please Log in or Create an account to join the conversation.

More
12 years 10 months ago #132932 by aspkiddy
Hi,
I tried several times : :ohmy:
Code:
$this->mailer->addBCC('aspkiddy@hotmail.com');

or
Code:
$address= 'aspkiddy@hotmail.com'; $this->mailer->addBCC( $address );

or
Code:
$address= "aspkiddy@hotmail.com"; $this->mailer->addBCC( $address );

But it did not work with those codes :woohoo:

Please Log in or Create an account to join the conversation.

More
12 years 10 months ago #133362 by aspkiddy
Hi,

I don't find a solution to my problem. Those above code in my previous post do not work in my site. :(

On your demo web site, I would like try those codes but I can not because I have only Manager Access.


So how I must do ?

Thanks

Please Log in or Create an account to join the conversation.

More
12 years 10 months ago #133497 by Jerome
The following user(s) said Thank You: aspkiddy

Please Log in or Create an account to join the conversation.

More
12 years 10 months ago #133720 by aspkiddy
Hi Jerome,

I find the solution with yours second link

www.hikashop.com/forum/4-how-to/23622-se...people.html?start=20

thank you very much

Please Log in or Create an account to join the conversation.

Time to create page: 0.342 seconds
Powered by Kunena Forum