Question: What Hook or Workflow NG event get's me the newly created anonymous C/O User

Posts: 56
Joined: 07/16/2008
Getting busy with the Ubercode.

Question. What hook or Workflow NG event can I use to perform an action on the newly created anonymous order user.

What's i'm doing is allowing users to register for mailchimp newsletters if they are doing an anonymous checkout.

I need a "hook" where I can get at the newly created user and check to see what (if any) newsletters they signed up for on the checkout_pane i've created and attach them to their account.

I trolled trough uc_cart.module and notice that "checkout_complete" workflow ng is called...would you say this is the proper place?

I'll release my add-on for the mailchimp/ubercart integration once I'm finished with this project.

MailChimp Module:
http://drupal.org/project/mailchimp

MailChimp is pretty nifty, but the Drupal module needs some love to speed it up and to improve integration.

Posts: 5617
Joined: 08/07/2007
AdministratorHead Code Monkey - I eat bugs.

Yep, the checkout_complete event is the right one. The only trick of course is that it doesn't automatically distinguish between new and existing users. You should be able to check the $user->created timestamp to tell, tho. (Looking at the DB it might make more sense to check $user->login.)

Posts: 56
Joined: 07/16/2008
Getting busy with the Ubercode.

much appreciated. I got it mostly working yesterday, but still trying to figure out eactly how to programmatically create an "action" based off an event. Should be able to finish it today.

Edit: Here's the docs in case anyone is interested: http://drupal.org/node/156754

Thanks for the tips,
Jordan