Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Rhinorhino on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Send Confirmation Mail to Customer 1

Status
Not open for further replies.

Muppsy007

Programmer
Joined
Apr 4, 2003
Messages
98
Location
NZ
Hi, couldn't find much on my exact problem in the search. I think this is more design advice than programming.

What we have is a service order page. The customer fills it out and presses submit. This submit action updates the data to a MySQL database and redirects to a confirmation page.

At this confirmation page, the customer checks the details and clicks submit again. This time a formmail cgi script is called and sends an email to relevant person here at work. This also redirects the user to a Thankyou page where the customer then leaves.

What I want to do somewhere after the second Submit, is send the customer a confirmation email, in a different format to what gets sent to our people at work.

Can this be done in the same process (IE call two cgi scripts)? Any Ideas at all. I'm a PHP newbie and CGI illiterate.

Thanks
 
Yes, you can, or what about just adding the customer as a CC or BCC on the email to the 'relevant person'?

Code:
mail($toCustomer,"Order Received","Thanks for your order",$optionalHeaders);

mail($relevantPerson, "Order",$body_of_email, $optionalHeaders);



Bastien

Cat, the other other white meat
 
Thanks Bastien, I'm not sure if this is what we're after.

I guess we want a better formatted version of the one we send to our people at work, including our address, a http:// link to a map of our location. Sending the same message as CC or BCC won't do.

I think I may be asking the impossible from CGI thinking about it now.

Thanks anyway.
 
Nothing impossible or difficult about it.

Since we're in the PHP forum, I'll use PHP syntax, but you can apply this logic to Perl/CGI as well (not sure what you're using).

So somewhere you have something akin to
Code:
$body = 'yadda yadda yadda...blah blah blah';

mail ($internal, "Order".$order_number, $body);

All you need to do is add
Code:
$cust_body = 'prettier yadda yadda yadda...';
mail ($customer, "Order ".$order_number." received!", $cust_body);

If you want to put it all in another script, just use includes, or better yet, functionalize it.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top