Download & Extend

Allow tokens in sender field for checkout notifications

Project:Ubercart
Version:6.x-2.x-dev
Component:Orders
Category:bug report
Priority:normal
Assigned:Unassigned
Status:closed (fixed)
Issue tags:token

Issue Summary

I would like to use a token in the "Sender" field for the admin checkout notification email (sends an order invoice). When I do, however, I receive the following error in the watchdog log:
"Error sending e-mail (from [order-email] to user@example.com)" I would expect this field to be checked for tokens since the help info for that field reads: "Enter the 'From' email addresses, or leave blank to use your store email address. You may use order tokens for dynamic email addresses." I would expect tokens to be replaced for this field using similar logic used in uc_order.ca.inc line 1213:

  // Apply token replacements to from e-mail address.
  $from = token_replace_multiple($settings['from'], $settings['replacements']);
  if (empty($from)) {
    $from = uc_store_email_from();
  }

To accomodate this, I simply applied this logic near line 1309 in uc_order_ca.inc for the uc_order_action_email_invoice function as well as uc_order.module's uc_order_mail function near line 596. I have attached the patch file that needs to be tested for this to work. Please let me know if you need it to be adjusted an d I can re-roll.

AttachmentSizeStatusTest resultOperations
uc_order-email-from.patch2.77 KBIdleFAILED: [[SimpleTest]]: [MySQL] Unable to apply patch uc_order-email-from.patch. Unable to apply patch. See the log in the details link for more information.View details

Comments

#1

Status:needs review» needs work

The last submitted patch, uc_order-email-from.patch, failed testing.

#2

Status:needs work» needs review

This patch is a simplified version of the one you posted; if you could test it that would be appreciated.

AttachmentSizeStatusTest resultOperations
1828290-email-sender-tokens.patch1.79 KBIdlePASSED: [[SimpleTest]]: [MySQL] 2,073 pass(es).View details

#3

Works for me.

#4

Status:needs review» fixed

Committed.

#5

Status:fixed» closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.