Multiple email addresses

Get help with nopcart's interaction with payment provider gateways like Authorize.net, Worldpay, etc.

Moderators: Koibito, Stefko, Randy

Multiple email addresses

Postby judithhavemann » Sat Apr 14, 2012 12:18 pm

I need to send the order confirmation to 3 different email addresses. I have set up the code below and only recieve the first email.
Please can someone help?

$header = "header.html";
$footer = "footer.html";
$returnpage = "http://www.myweb.com";
$youremail = "ads@hapss.co.za";
$youremail2 = "networking@hapss.co.za";
$youremail3 = "queries@hapss.co.za";
$csvfilename = "orders.csv";
$csvquote = "\"\"";
$mode = "BOTH";

//
judithhavemann
WebMaster
 
Posts: 5
Joined: Sat Apr 14, 2012 11:31 am

Re: Multiple email addresses

Postby Koibito » Sat Apr 14, 2012 4:30 pm

Is that the PHP checkout script?

Just add the e-mail addresses like this:
Code: Select all
$youremail = "ads@hapss.co.za, networking@hapss.co.za, queries@hapss.co.za";
John
Koibito
Site Admin / Guru
 
Posts: 918
Joined: Sun May 28, 2006 1:59 am
Location: New Jersey, USA

Re: Multiple email addresses

Postby judithhavemann » Sat Apr 14, 2012 5:30 pm

Hi
Thanks for the prompt reply.
I do not know php coding and am just trying to get this setup to work (done by someone else for me who has just bailed out)
I am not sure what you mean by CODE : SELECT ALL
Where would this go?

I tried just inserting the email address as you said but it just send three notifications to my own email address (as I was placing the order) and then just one the the first on the list (ads@haps.co.za)

I have copied the first section of the page (where it includes the email addresses) called
checkout.php

<?
//=====================================================================||
// NOP Design JavaScript Shopping Cart ||
// PHP SCRIPT Checkout Module ||
// ||
// For more information on SmartSystems, or how NOPDesign can help you ||
// Please visit us on the WWW at http://www.nopdesign.com ||
// ||
// Javascript portions of this shopping cart software are available as ||
// freeware from NOP Design. You must keep this comment unchanged in ||
// your code. For more information contact FreeCart@NopDesign.com. ||
// ||
// JavaScript Shop Module, V.4.4.0 ||
//=====================================================================||
// ||
// Function: Writes available form elements from the NOP ||
// Free Cart (http://www.nopdesign.com/freecart) ||
// and other form elements to an email file, and ||
// send user confirmation ||
// ||
//=====================================================================||


//######################################################################
// #
// User defined variables: #
// $header - string value containing the complete #
// path of the HTML page header #
// $footer - string value containing the complete #
// path of the HTML page footer #
// $youremail - string value containing the email address to #
// send catalog orders in EMAIL or BOTH modes #
// $returnpage - URL to send user when checkout is complete #
// $csvfilename - string value containing the complete #
// path of the user database. #
// $csvquote - string value containing what to use for quotes #
// in the csv file (typically "" or \") #
// $mode - string value containing 'EMAIL', 'FILE' or #
// 'BOTH' to determine if the script should send #
// an email to you with the new order, write the #
// order to a CSV file, or do both. #
//######################################################################

$header = "header.html";
$footer = "footer.html";
$returnpage = "http://www.30degreessouth.co.za";
$youremail = "ads@haps.co.za, ";
$youremail2 = "networking@haps.co.za";
$youremail3 = "queries@haps.co.za";
$csvfilename = "orders.csv";
$csvquote = "\"\"";
$mode = "BOTH";

//##############################################################
//#FUNCTION: doFormError #
//#RETURNS: #
//#PARAMETERS: A error message string. #
//#PURPOSE: Generates an HTML page indicating a form #
//# submission error occurred. #
//##############################################################
function doFormError($errString) {


echo "<FONT SIZE=+2>The form you submitted was not complete.<BR><BR></FONT>";
echo "$errString<BR><BR>\n";
echo "<INPUT TYPE=BUTTON ONCLICK='history.back()' VALUE=' Return to the checkout page '><HR>";


exit;
judithhavemann
WebMaster
 
Posts: 5
Joined: Sat Apr 14, 2012 11:31 am

Re: Multiple email addresses

Postby Koibito » Sat Apr 14, 2012 7:51 pm

Don't look at 'code, select all'. Just replace the line with $youremail by:

$youremail = "ads@hapss.co.za, networking@hapss.co.za, queries@hapss.co.za";

and remove the two lines with $youremail2 and $youremail3.
John
Koibito
Site Admin / Guru
 
Posts: 918
Joined: Sun May 28, 2006 1:59 am
Location: New Jersey, USA

Re: Multiple email addresses

Postby judithhavemann » Sat Apr 14, 2012 8:29 pm

Hi
I have done it exactly as you said - like this

$header = "header.html";
$footer = "footer.html";
$returnpage = "http://www.30degreessouth.co.za";
$youremail = "ads@haps.co.za, networking@haps.co.za, queries@haps.co.za";
$csvfilename = "orders.csv";
$csvquote = "\"\"";
$mode = "BOTH";

but it does the wierdest thing!
It sends me an email to ads@haps.co.za, and then 3 emails to judy@haps.co.za (which is the email address I sent the order from)

What now??
And thanks for the prompt responses!
judithhavemann
WebMaster
 
Posts: 5
Joined: Sat Apr 14, 2012 11:31 am

Re: Multiple email addresses

Postby Koibito » Sun Apr 15, 2012 5:48 pm

Did you reload the checkout page a couple of times while ordering maybe? It will send an e-mail to the customer every time you reload the page.

See if this works for the three e-mails. Replace:

mail($youremail, $subject, $strMessageBody, $mailheaders);

by:

mail('ads@hapss.co.za, networking@hapss.co.za, queries@hapss.co.za', $subject, $strMessageBody, $mailheaders);
John
Koibito
Site Admin / Guru
 
Posts: 918
Joined: Sun May 28, 2006 1:59 am
Location: New Jersey, USA


Return to Help: Payment Gateways

Who is online

Users browsing this forum: No registered users and 1 guest

cron