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.
Comment | File | Size | Author |
---|---|---|---|
#2 | 1828290-email-sender-tokens.patch | 1.79 KB | longwave |
uc_order-email-from.patch | 2.77 KB | pcorbett | |
Comments
Comment #2
longwaveThis patch is a simplified version of the one you posted; if you could test it that would be appreciated.
Comment #3
romansta CreditAttribution: romansta commentedWorks for me.
Comment #4
longwaveCommitted.