Post by d77 » Sun Sep 23, 2007 3:38 am

i posted this in the forum earlier, but it needs a better home here.

when a customer completes a purchase, they receive an email containing the order details. this mod sends a "blind carbon copy" of that email to the shop admin email address.

hopefully we will see this or a similar change integrated into the core opencart product. i feel it would be really useful as a configurable feature.

instructions are included in install.txt
works with opencart 0.7.6.1

Attachments


User avatar
d77
Active Member

Posts

Joined
Sat Apr 14, 2007 8:04 am

Post by ytr » Fri Sep 28, 2007 11:09 pm

Thank you, it is very helpful :)

And in accordance I have a question:
How can I set Newsletter that subscribers will not see all their e-mails?

See you

ytr
Newbie

Posts

Joined
Fri Sep 28, 2007 9:46 pm

Post by d77 » Fri Sep 28, 2007 11:39 pm

i never got to test this behavior, but my assumption is that the newsletter correspondence will also have this issue.

i'm guessing all recipients of the newsletter are going to be able to see everyone else's e-mail address in the TO list, which is NOT what we want in any type of mass mailing. i think the change i supplied to support BCC is part of the solution, but the newsletter script needs to change to use BCC instead of TO.

shouldn't be too hard... but the problem is, who goes in the TO field? maybe the shop address? i'm not sure this is how major mailing list scripts work. any advice here would be appreciated.

User avatar
d77
Active Member

Posts

Joined
Sat Apr 14, 2007 8:04 am

Post by ytr » Sun Sep 30, 2007 4:57 pm

In admin/controller/newsletter.php
I've change line
$mail->setTo($email);
to
$mail->setBcc($email);

but I doesn't work and there appears - "Error: To not set"

Of course I've got in library/mail/mail.php Bcc support (as in attachment)

Any suggestions?

Attachments

[The extension has been deactivated and can no longer be displayed.]


ytr
Newbie

Posts

Joined
Fri Sep 28, 2007 9:46 pm

Post by luvz2drv » Sun Sep 30, 2007 6:21 pm

To should pull from the shop email...    then send out... BCC to the rest

that is kinda a logic way of doing it.

or get all email address and send them 1 at a time...


looping thru

not so effeint

luvz2drv


Post by d77 » Sun Sep 30, 2007 8:55 pm

ytr - you've got the basic idea, but an email still needs a "TO" address. my thought was to put the shop address in the TO field, and BCC all the customers. try this:

Code: Select all

$mail->setTo($config->get('config_email'));
$mail->setBcc($email);
why is mail.php attached? is this any different from the mail.php attached in my mod zip?
Last edited by d77 on Sun Sep 30, 2007 9:01 pm, edited 1 time in total.

User avatar
d77
Active Member

Posts

Joined
Sat Apr 14, 2007 8:04 am

Post by ytr » Mon Oct 01, 2007 4:29 pm

d77 - thanks
code
$mail->setTo($config->get('config_email'));
$mail->setBcc($email);
works

mail.php I've attached is yours :)

ytr
Newbie

Posts

Joined
Fri Sep 28, 2007 9:46 pm

Post by cah » Sun Jan 06, 2008 5:41 pm

Thank you d77!
This is very helpful. However, after I changed the store language, the BCC e-mail is not sent to the store owner address, it is sent to the customer twice instead. How should I fix this?

cah
Newbie

Posts

Joined
Fri Jan 04, 2008 12:17 am

Post by Kimmiekins » Tue Jun 03, 2008 2:21 am

I've been trying to get the BCC to admin mod working, and not having any luck. I AM receiving the order email from OC as the customer, so the mail server isn't the problem and the mail script is working fine otherwise. I have done everything listed here:

http://forum.opencart.com/index.php/topic,427.0.html

Multiple times, and still not getting the BCC email to the admin after an order.

I need this working for this particular (my first setup with OC - love it!), as my client is not the most web-savy and would be better off reading emails with the order than going into the system itself (someone else will be updating the status of the orders).

Anyone? Thanks in advance!

Newbie

Posts

Joined
Tue Jun 03, 2008 1:50 am

Post by bruce » Tue Jun 03, 2008 1:05 pm

I hate to ask, but have you put a value in the email address field of the mail tab in your store admin?

If yes, could you please post the contents of your Mail.php for us to review?

Active Member

Posts

Joined
Wed Dec 12, 2007 2:26 pm

Post by lev » Wed Jun 04, 2008 11:35 pm

To administer email server settings and carbon copy to store manager:

apply the changes in the zip to:
/admin/controller/settings.php
/admin/language/english/controller/setting.php
/library/mail/mail.php

to send mail (like in admin/controller/mail.php) simply use

Code: Select all

if ($email) {
					$mail->setTo('Confidential Recipients <' .$config->get('config_email').'>');
					$mail->setCc($config->get('config_email_cc'));
					$mail->setBcc($email);
					$mail->setFrom($config->get('config_email'));
	    			$mail->setSender($config->get('config_store'));
	    			$mail->setSubject($request->get('subject', 'post'));
					$mail->setHtml($request->get('content', 'post'));	    	
	    			$mail->send();
				}
This will send an email out to your client without exposing other emails (in case of newsletter), send to your email as the to, and will let you specify through your admin panel (under Admin->Configuration->Setting Mail tab) if a carbon copy is needed!

lev
New member

Posts

Joined
Wed Apr 30, 2008 10:47 pm

Post by jamble » Tue Jun 24, 2008 2:25 am

Hi Guys,

I've tried getting this working and had no luck, newsletters are still coming through with all customers emails in the To: field.

I've updated the 3 files in the zip and my admin/mail/mail.php file to include the snippet above from Lev but nothing appears to have changed when I send newsletters.

I've attached my admin/mail/mail.php file here if anyone could see if anything is missing/incorrect?

I have set a mail in my store config for the site so it's not missing that info.

Thanks!

Attachments

[The extension has been deactivated and can no longer be displayed.]


Newbie

Posts

Joined
Thu May 08, 2008 11:08 pm

Post by gibpat » Wed Jun 25, 2008 9:24 am

I too seem to be having troubles...
Ive followed Lev's instructions but still no luck, i dont have a bcc option in settings -> mail and admin doesnot receive a copy of order.

Anyone got any ideas?

New member

Posts

Joined
Fri Jun 06, 2008 9:09 am

Post by bruce » Wed Jun 25, 2008 10:39 pm

There are two locations to change in admin\controller\newsletter.php

The first is in the insert() function, the second in the update() function.

Active Member

Posts

Joined
Wed Dec 12, 2007 2:26 pm

Post by gibpat » Thu Jun 26, 2008 12:18 pm

bruce wrote: There are two locations to change in admin\controller\newsletter.php

The first is in the insert() function, the second in the update() function.
Have done this thanks bruce, any ideas how to get the bcc option into my admin panel? Admin still does not receive order email...

New member

Posts

Joined
Fri Jun 06, 2008 9:09 am

Post by bruce » Thu Jun 26, 2008 2:22 pm

and library\cart\order.php has been modified to look as follows?

Code: Select all

			if ($this->config->get('config_email_send'))
			{
				$this->mail->setTo($this->data['email']);
				$this->mail->setBcc($this->config->get('config_email'));
				$this->mail->setFrom($this->config->get('config_email'));
				$this->mail->setSender($this->config->get('config_store'));
				$this->mail->setSubject($this->data['email_subject']);
				$this->mail->setText($this->data['email_text']);
				$this->mail->setHtml($this->data['email_html']);
				$this->mail->send();
			}

Active Member

Posts

Joined
Wed Dec 12, 2007 2:26 pm

Post by lev » Fri Jun 27, 2008 10:01 pm

Guys,
  I apologize for leaving you hanging for so long... I see there are questions... I will try to answer as best as I can.

Please let me know the specifics of your difficulties (Admin panel settings does not show email server settings, all looks fine but email is never sent to bcc recepients, excetra... i will ensure we get you guys working  ;D

lev
New member

Posts

Joined
Wed Apr 30, 2008 10:47 pm

Post by lev » Fri Jun 27, 2008 10:08 pm

jamble,
It looks like your code changes are good, you just need to change the code in /admin/controller/newsletter.php!

Currently, you have this around line 51 of that file for the insert finction and line 104 for the update function (AS BRUCE SAID, BOTH MUST BE CHANGED)! :

Code: Select all

if ($email) {
					$mail->setTo($email);
					$mail->setFrom($config->get('config_email'));
	    			$mail->setSender($config->get('config_store'));
	    			$mail->setSubject($request->get('subject', 'post'));
					$mail->setHtml($request->get('content', 'post'));	    	
	    			$mail->send();
				}
change the code to use the suggested settings (read brunces latest post) and you will be golden  ;D

lev
New member

Posts

Joined
Wed Apr 30, 2008 10:47 pm

Post by lev » Fri Jun 27, 2008 10:11 pm

Gibpat,
  If you do not see the email server settings in your admin panel, ensure
The code changes i included for the /admin/controler/settings.php, admin/language/english/controller/setting.php and admin/template/default/controller/setting.php have all been applied!!

lev
New member

Posts

Joined
Wed Apr 30, 2008 10:47 pm

Post by gibpat » Mon Jun 30, 2008 1:12 pm

lev wrote: Gibpat,
  If you do not see the email server settings in your admin panel, ensure
The code changes i included for the /admin/controler/settings.php, admin/language/english/controller/setting.php and admin/template/default/controller/setting.php have all been applied!!
I must be going blind, i cannot find any instructions for admin/template/default/controller/setting.php, should i be looking elsewhere?

New member

Posts

Joined
Fri Jun 06, 2008 9:09 am
Who is online

Users browsing this forum: No registered users and 21 guests