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.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Status: Needs review » Needs work

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

longwave’s picture

Status: Needs work » Needs review
FileSize
1.79 KB

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

romansta’s picture

Works for me.

longwave’s picture

Status: Needs review » Fixed

Committed.

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