Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Receipt Email


Guest

Recommended Posts

Posted

I try hard to reply to customers quickly when they have comments on their order. I also have problems with deleivery date requests from time to time (I'm using Ask Extra Questions and love it).

 

I'd like to have the email sent to me contain a mailto link with the customer's email address. I'd like it even more if it filled in the order number in the subject. I'd really like it if it had the comments (if any entered) in the email already as well.

I'm competent at php and can splice code into the correct file(s), but I don't have the time to figure this out. I'd be truly grateful if someone has this bit of code or could work it out. I think it would benefit many shop owners.

Posted

OK, I got the first part just fine. I added this:

   $email_order .= "\n" . $order->customer['email_address'] . "\n\n";

 

just before the comments:

  if ($order->info['comments']) {
$email_order .= EMAIL_TEXT_COMMENTS . ' ' . $order->info['comments'] . "\n\n";

It adds an email link but I don't know how to add the subject line, etc.

Posted
OK, I got the first part just fine. I added this:

   $email_order .= "\n" . $order->customer['email_address'] . "\n\n";

 

just before the comments:

  if ($order->info['comments']) {
$email_order .= EMAIL_TEXT_COMMENTS . ' ' . $order->info['comments'] . "\n\n";

It adds an email link but I don't know how to add the subject line, etc.

 

 

the subject is currently taken from your language file as EMAIL_TEXT_SUBJECT:

 

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

 

 

you can add any data to that parameter.

Treasurer MFC

Posted

Thanks, Amanda. I'm not sure how I add that information to fill in the subject in my link. What I've done so far only results in the customer's email address being printed in the email receipt. Can I use the parameters you've given in my code somehow to add these when I click on their address to reply to them? Do I need to rewrite my code bit entirely to include them?

Posted
Thanks, Amanda. I'm not sure how I add that information to fill in the subject in my link. What I've done so far only results in the customer's email address being printed in the email receipt. Can I use the parameters you've given in my code somehow to add these when I click on their address to reply to them? Do I need to rewrite my code bit entirely to include them?

 

well, I use this line:

 

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

 

which adds the order id to the email subject.

Treasurer MFC

Posted

Yes, but that's the line which will send the email confirmation to the customer. I use it the same way you do, with the order number in the subject line, etc. I'm happy with the information sent to them.

I want a fast way to reply to their comments when I read them in my copy of the receipt sent to my address.

I'm talking about adding parameters to their email address link in the receipt that I've added so I can easily shoot them an email about their order when I read my copy of the receipt. I have their email address showing up, so it is already much easier now. It would just be more convenient if the subject of my reply had the order number and the contnets had their comments filled in when I click that link in my copy of the receipt.

Does that make more sense?

Posted
Yes, but that's the line which will send the email confirmation to the customer. I use it the same way you do, with the order number in the subject line, etc. I'm happy with the information sent to them.

I want a fast way to reply to their comments when I read them in my copy of the receipt sent to my address.

I'm talking about adding parameters to their email address link in the receipt that I've added so I can easily shoot them an email about their order when I read my copy of the receipt. I have their email address showing up, so it is already much easier now. It would just be more convenient if the subject of my reply had the order number and the contnets had their comments filled in when I click that link in my copy of the receipt.

Does that make more sense?

 

ah, like that:

 

well you could write in the email:

 

$email_order .= '<a href="mailto:' . $order->customer['email_address'] . '?subject=' . EMAIL_TEXT_SUBJECT . ' #' . $insert_id . '">email this client</a>';

Treasurer MFC

Posted

Yes, that's exactly what I'm after! Thanks for sticking with me on this, Amanda! I've tried it but nothing shows. In the href, do I need a quote " after the colon in mailto:? Also, since this will show up on the customer's copy, too. I only want it to show their email address. There's no need for it to say email this client. I'll drop the text.

Posted

I'm looking at syntax for html for mailto: and your line looks perfect, but it isn't showing up at all in my receipts. The simple line I added above works. Any thoughts?

Posted
Yes, that's exactly what I'm after! Thanks for sticking with me on this, Amanda! I've tried it but nothing shows. In the href, do I need a quote " after the colon in mailto:? Also, since this will show up on the customer's copy, too. I only want it to show their email address. There's no need for it to say email this client. I'll drop the text.

 

don't think so, the final output source should read:

 

<a href="mailto:[email protected]?subject=your order at our shop #123">email this client</a>

Treasurer MFC

Posted
I'm looking at syntax for html for mailto: and your line looks perfect, but it isn't showing up at all in my receipts. The simple line I added above works. Any thoughts?

 

we were posting at the same time. This was my previous post.

could it be my email preferences? not sending html?

Posted
we were posting at the same time. This was my previous post.

could it be my email preferences? not sending html?

 

well, you need to send html emails for html links to work ofcourse.

Treasurer MFC

Posted

Yeah, I had a feeling. I'll set it up. Thanks again, Amanda. You're really helpful and I love how you see things through.

Posted

Switched on html emails in my store and it still doesn't show. The format in the receipt now looks essentially the same but greatly expanded (empty lines between the lines of data). I've never done html emails for receipts. Is there more to it?

Posted
Switched on html emails in my store and it still doesn't show. The format in the receipt now looks essentially the same but greatly expanded (empty lines between the lines of data). I've never done html emails for receipts. Is there more to it?

 

in your email client you can right click and select view source to see what is generated.

Treasurer MFC

Posted

OK, got it working. You had it all along, of course. I was bouncing around too much between this and my toddler. She's wonderful and distracting.

My html output in the email adds extra blank lines every other. Is there another setting I should change? What other factors should I consider about sending mail by html?

Archived

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

×
×
  • Create New...