email confirmation: to the client/ us with BCC

  • Posts: 98
  • Thank you received: 1
10 years 5 months ago #131243

-- 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:

<?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:
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.

  • Posts: 13201
  • Thank you received: 2322
10 years 5 months ago #131279

Hi,

In the email, you have to add the address in the var:

$data->mail->dst_email .= ', your_email@gmail.com';

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

  • Posts: 98
  • Thank you received: 1
10 years 5 months ago #131381

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)

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 :
$data->mail->dst_email .= ', my_second_email@gmail.com'; /* new code by Xavier */
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: 10 years 5 months ago by aspkiddy. Reason: corection

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

  • Posts: 13201
  • Thank you received: 2322
10 years 5 months ago #131412

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.

  • Posts: 98
  • Thank you received: 1
10 years 5 months ago #131514

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 :(

<?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.

  • Posts: 81562
  • Thank you received: 13071
  • MODERATOR
10 years 5 months ago #131537

You should do like that:
$data->mail->dst_email .= ',This email address is being protected from spambots. You need JavaScript enabled to view it.';

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

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

  • Posts: 98
  • Thank you received: 1
10 years 5 months ago #131546

Hi Nicolas,
I understand you
I must add following 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 :
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.

  • Posts: 81562
  • Thank you received: 13071
  • MODERATOR
10 years 5 months ago #131584

No you should do like that:

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

Last edit: 10 years 5 months ago by Jerome.

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

  • Posts: 98
  • Thank you received: 1
10 years 5 months ago #132131

nicolas wrote: No you should do like that:
defined('_JEXEC') or die('Restricted access');
$data->mail->dst_email .= ',This email address is being protected from spambots. You need JavaScript enabled to view it.';
?>

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

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

  • Posts: 26013
  • Thank you received: 4004
  • MODERATOR
10 years 5 months ago #132152

Hi,

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

Regards,


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

Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.

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

  • Posts: 98
  • Thank you received: 1
10 years 5 months ago #132324

Hi Jerome,

I tried two times :(
1st time, like this : (no space between the coma and the email address)

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
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.

  • Posts: 13201
  • Thank you received: 2322
10 years 5 months ago #132530

Hi,

Sorry this seems to have a little bit changed.
Thanks to use:

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

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

  • Posts: 98
  • Thank you received: 1
10 years 5 months ago #132595

Xavier wrote: Hi,

$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: This email address is being protected from spambots. You need JavaScript enabled to view it., This email address is being protected from spambots. You need JavaScript enabled to view it.


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

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

  • Posts: 26013
  • Thank you received: 4004
  • MODERATOR
10 years 5 months ago #132698

Hi,

Well, I guess you can access to the Joomla mailer object

$this->mailer
So
$this->mailer->addBCC( $address );
Regarding : api.joomla.fr/jplatform/classPHPMailer.h...db5329912a5ffc9bffdd

Regards,


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

Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.
Last edit: 10 years 5 months ago by Jerome.

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

  • Posts: 98
  • Thank you received: 1
10 years 5 months ago #132888

Hi Jerome,

I'm confused, :blink:

Where I must add this code ?
In Email (I added : System >>> Emails) ?

$address= 'aspkiddy@hotmail.com';
$this->mail->addBCC($address);
or
$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.

  • Posts: 26013
  • Thank you received: 4004
  • MODERATOR
10 years 5 months ago #132918

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:

$this->mailer->addBCC( $address );
In the email yes, it's good.
Regards,


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

Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.
Last edit: 10 years 5 months ago by Jerome.

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

  • Posts: 98
  • Thank you received: 1
10 years 5 months ago #132932

Hi,
I tried several times : :ohmy:

$this->mailer->addBCC('aspkiddy@hotmail.com');

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

or
$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.

  • Posts: 98
  • Thank you received: 1
10 years 5 months ago #133362

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.

  • Posts: 26013
  • Thank you received: 4004
  • MODERATOR
10 years 5 months ago #133497

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

Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.
The following user(s) said Thank You: aspkiddy

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

  • Posts: 98
  • Thank you received: 1
10 years 5 months ago #133720

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.109 seconds
Powered by Kunena Forum