Customer notification with uc_order_comment_save

Project: 
Ubercart
Category: 
bug report
Version: 
Ubercart 1.x-dev
Priority: 
normal
Status: 
fixed

The Ubercart API documentation for uc_order_comment_save() makes it seem like if the $notify argument is set to TRUE, then Ubercart will send to the customer an updated copy of the invoice:
http://www.ubercart.org/docs/api/uc_order_comment_save

However, the code for uc_order_comment_save shows that when the $notify argument is set, the only difference is that the 'notified' field in the uc_order_comments table is set to 1. See the current source here:
http://bazaar.ubercart.org/drupal5/ubercart/uc_order/uc_order.module

Am I missing something? Does the API describe behavior that is intended but as of yet unimplemented?

Thanks.

Re: Customer notification with uc_order_comment_save

Hmm... yeah, this may have been lost in the shuffle. If you have uc_notify.module enabled, it should show a checkbox on the order view page to notify a customer and then send an e-mail to the customer containing just the updated order status and the comment left if you check it. Let me know if this isn't the case.

The function itself may have handled the e-mail at some point, but it must have been abstracted out to the notifications module. I'll update the documentation to read that the variable should just be set to TRUE when a notification has been sent and not to send a notification.

Re: Customer notification with uc_order_comment_save

Yes, there is the checkbox on the order view page for sending an e-mail when the order is updated by the administrator.

I was working on a module and hoped to (re)use code from uc_notify for sending an e-mail on a particular status change. Unfortunately, the function (uc_notify_order_update) that handles sending this e-mail is a form callback -- not really meant as an API function.

As a future feature request, I'd like to see the uc_notify module become reusable so that the numerous modules that need to send notifications do not need to repeat the general procedure for sending mail.

Re: Re: Customer notification with uc_order_comment_save

+5 to reworking the notifications module. I'm seriously considering removing the module altogether and instead doing something like total workflow-ng integration. This would provide much more flexibility, imo, and we could still wire it to use invoice templates (and move said templates out of the uc_order directory).

If you want to get in on the action, be on the lookout for a post or posts from mikejoconnor and Jonathan (dunno if he's registered yet) as they think through how the system should change. It may not happen till Uber 2.0, but it will happen.

And man... I never even realized that that function was simply a form submit handler. The API for that module could definitely use some lovin'. I imagine if we re-wrote that module today, we'd do it a lot better knowing the code practices we know now. Sticking out tongue