The default setting for the Send To for a purchased Role expiration and revoke notice is set to "[user-mail] The email address of the currently logged in user". Which literally sends the notice to the logged in user instead of the person who is expiring and I don't see any token that has anything to do with the actual Role order email. So is this a bug or does anyone know what's going on here.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

cha0s’s picture

Assigned: Unassigned » cha0s
Status: Active » Needs review
FileSize
1.64 KB
1.64 KB

Yeah, you're right. This should be the correct behavior.

b0b’s picture

Thanks for that! I only did one test, but it appears to be working now.

Island Usurper’s picture

Status: Needs review » Fixed

Yep. Looks good. Committed.

Status: Fixed » Closed (fixed)

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

recrit’s picture

Version: 6.x-2.0-rc2 » 6.x-2.0-rc6
Status: Closed (fixed) » Active

did this slip through the cracks for rc6?
uc_roles.ca.inc: lines 130 and 176 show [user-mail]

recrit’s picture

adding to my previous post after debugging some more...

I was not receiving expiration reminder emails, so started looking into it and noticed they were going to my currently logged in account that was running the cron. I found this issue and look at the uc_roles.ca.inc code and indeed it sets the default to [user-mail] (still has last half of the patch from #1, but not the [mail] patch). So instead of using the patch, I changed the setting in the conditional action to [mail]. To my surprise, I still got the reminders at the wrong address. Following the debugging further down the line to uc_roles_action_user_email I found the problem.

RC6
line 349: function uc_roles_action_user_email($account, $role_expiration, $settings) {
line 350:   $account = uc_order_user_load($order);

$order is never passed to this function so the uc_order_user_load function will output the global user and this will be used in the replacements for the recipient address. This appears to be a copy-paste error from uc_roles_action_order_email which does have $order passed to it.

FIX: remove line 350

Island Usurper’s picture

Assigned: cha0s » Island Usurper
Status: Active » Fixed
FileSize
1.18 KB

Yeah, it was either copypasta, or there was a bad merge from another patch. Repatched and committed.

recrit’s picture

looks good, thanks for the quick response!

Status: Fixed » Closed (fixed)

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