Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Seperate emails for seperate payment types


Bazkaz

Recommended Posts

Posted

Hello,

 

I'm working on a site that someone else had previously and it's setup to send a different email whether you pay by check/money order or through PayPal. However when I go to: /includes/languages/english/checkout_process.php

 

I get a different email than what is actually being sent to the customers. Any ideas as to where I should be looking? Maybe the last owner had a contribution they installed for this? Anyone familiar with it?

 

Thanks,

Baz

Posted

search the catalog\checkout_process.php its where the emails are sent with the tep_mail function

Posted

Thanks enigma. It looks like he had installed PayPal IPN. I found:

 

  tep_mail($order->customer['firstname'] . ' ' . $order->customer['lastname'], $order->customer['email_address'], sprintf(EMAIL_TEXT_SUBJECT, $insert_id), $email_order, STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS);


 $email_order.="\n\n" . 'EXTRA CUSTOMER INFORMATION' . "\n" . 
               EMAIL_SEPARATOR . "\n" . 
 'Customer Telephone:' . $order->customer['telephone'] . "\n" . 
 'Customer Email:' . $order->customer['email_address'] . "\n\n";

 

Just above that it goes through the start of the the rest of the email confirmation. I haven't used the PayPal IPN before. This is where I would add anything I need to in the confirmation?

 

With the PayPal mod in there is it possibel to edit from just one place so that my PayPal & Check emails look the same, or do I need to just change it in both places?

Posted

ok I understand now. Dont change anything in the code yet. Goto the osc admin panel and for each payment module setup the correct email address. That should do it.

Posted
ok I understand now. Dont change anything in the code yet. Goto the osc admin panel and for each payment module setup the correct email address. That should do it.
Ok, now I'm confused. I want to be able to edit the email sent to my customer. Right now I have two different emails. One sent if they pay with PayPal, and the other is sent if they pay with Check/Money Order.

 

I know I can edit the Check/Money Order one from:

/includes/languages/english/checkout_process.php

 

The PayPal one looks like it's in:

catalog\checkout_process.php

 

Is there any way to combine those two so I only have to make changes in one place and the same email is sent to the customer no matter which payment option they choose?

Posted

this is what I am saying:

 

goto admin->modules->payment then select paypal. Click edit and edit the email address as you need. Repeat for the other payment modules

 

That was for the email address, now for the content in checkout_process.php the $email_order collects the content of the email. Somewhere in there you have the payment class

$payment_class->title

which shows if its paypal or something else. You could send different email accordingly although the default osc does append the payment name at the end.

Posted

Ok I found the $email_order, but when I found "$payment_class->title" it looked like this:

$email_order .= $payment_class->title . "\n\n";

Should I see "PayPal" where it says "\n\n" ?

Posted

no thats fine this file process the name from whatever payment module a customer went through. So you could use the code field of the payment class.

Example:

if( !strcmp($payment_class->code, 'paypal') ) {
 // Send PayPal specfic mail append something at the end of the mail
 $email_order .= "\n" . 'paypal addon text';
} else if( !strcmp($payment_class->code, 'authorizenet') ) {
 // Send authorizenet specific mail
 $email_order .= "\n" . 'authorizenet addon text';
} else {
 // Regular mail
}

 

see the code string for each payment module and expand this paradigm as much as you like. You could simply insert that code just before the tep_mail function call.

 

But if you want a cliche or something more complicated like html code its better to setup the admin with new fields.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...