Jump to content

Resolved - I'd like to get a Delivery Receipt for Order Complete E


Dirty Butter

Recommended Posts

I use the PHP Mail() Function. Recently we've had a spurt of customers asking questions about when their item will be delivered, even though we sent the delivery information to them in the Order Complete email. Of course it could be a variety of things - didn't keep email, didn't read email, blocked in spam folder, sent to junk...

BUT, it would be useful to actually KNOW that they had received the email - Read receipt would not be as useful - as many people never say yes to sending it.

On searching the net I found this:

Does anyone of you know off by hand what mail headers to add in order to get a read receipt and delivery report? This now being when you use the normal PHP mail function. No fancy add-on script / class like phpMail.

For the reading confirmations:

You have to add the X-Confirm-Reading-To header.

X-Confirm-Reading-To: <address>

For delivery confirmations:

You have to add the Disposition-Notification-To header.

For usage details see RFC 3798 .

I'm guessing this would be accomplished somewhere in mailer.class.php. If the only way to do it is to get a Delivery Receipt for ALL emails sent to a customer I can live with that by setting a rule in Outlook to deal with the ones I don't want to keep.

Is this doable in CC?

If so, I need specific instructions on how to add it to the code.

Link to comment
Share on other sites

To try this, open the file /classes/mailer.class.php near line 30:

After this:


$this->From = $GLOBALS['config']->get('config', 'email_address');





add this:



$this->ConfirmReadingTo = $GLOBALS['config']->get('config', 'email_address');





There is a function in phpMailer* that will add this header if there is an address assigned to this variable.



There is no provision for a "X-Confirm-Reading-To" header, that is, unless the two headers are essentially the same thing.



Realize that the above is a global solution. For a more granular solution, we can add one of these lines:



$mailer->ConfirmReadingTo = $GLOBALS['config']->get('config', 'email_address');

$mailer->AddCustomHeader('Header:Value');



to any class method (such as those in order.class.php::Order_Complete) that sends emails to the customer.



So, yes, it's do-able.



If you want to specifically add this header to the ORDER_COMPLETE process, in order.class.php near line 420, find:



/* no need to send this email for digital only orders */

if(!$this->_skip_order_complete_email) {

$content = $mailer->loadContent('cart.order_complete', $order_summary['lang'], $this->_order_summary);

}

and add before the closing brace:

$mailer->ConfirmReadingTo = $GLOBALS['config']->get('config', 'email_address');

* This all depends on the ignorance or willingness of the recipient to allow such a thing. If the recipient does not realize their email reader can be configured to honor/reject such a header and the reader by default honors them, or the recipient does, in fact, configure their reader to honor them, that will be the only time you get a reading confirmation.

I've configured my reader to ignore them.

Link to comment
Share on other sites

Thanks for the help, but yes, the Read Receipt reply is all but useless. If it can't be Delivery Receipt it may not be worth doing. But I am going to change the title of the Order Complete email to Shipping Information instead. Maybe that will be more likely to be read.

I did end up leaving the code in order.class.php. If you ever figure out how to get the Delivered Receipt sent automatically, please revisit this thread.

Being able to prove they read it or at least that it was delivered to their inbox would come in handy. We've paid out insurance (we self insure) a couple of times lately for "lost" packages where we probably legally didn't have to (but for business reasons we did), thanks to not having this kind of proof that they knew it had been shipped.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...