Hello,

Thank you for writing this module. It does its job well and I've never had a problem.

I have a site where the profile info is stored as a node, part of the content_profile module. I have tried to alter your module, to provide the data from content_profile into the email that goes out. While watching the SQL statements as I created a new account, I see that this module sends out its notification, before the node is created. So the info in the email is blank, as the user does not yet have a node created for type='content_profile'.

I looked, but was not able to find where/how this call gets made, but I assume that as part of the user acct create, your code is called.

Is there a way to push this call back, so that it occurs after the node creation?

I guess I could grab the form data and populate the email that way, but that does not seem like the "right" way to do it :)

Thanks!

div

Comments

rmiddle’s picture

http://drupal.org/node/110238

I already move myself pretty low in the list.

Thanks
Robert

PS. What module are you using I might look into it and see if I can add support for it?

divbox’s picture

Thank you for your reply.

I am using the content_profile module http://drupal.org/project/content_profile

function user_register_notify_user($op, &$edit, &$account, $category = NULL) {
  switch ($op) {
    case 'insert':
      user_register_notify_setup_email($edit, $account);
      break;
    case 'update':
      if (variable_get('user_register_notify_alert', 'create') == 'update')
        user_register_notify_setup_email($edit, $account, 'update');
      break;
  }
}

When the insert happens, your code is called. This happens before the node creation, which is right as the user has to be created first, so the data is only available as part of the POST, not in the db. I wonder if I could call user_register_notify_setup_email($edit, $account); from within the content_profile module.

I did try setting up a trigger/action combo for this as well, but I think the same race condition happens, as almost all the serialized tokens were not available. I was also not able to set the trigger/action to just the content type of "content_profile", so it was firing on all new content creation, which is not what I want.

Going to look into getting data from the POST later this week, but I welcome any suggestions.

Thanks Robert!
div

rmiddle’s picture

divbox,

Sorry I haven't gotten back to you in a few weeks. I have checked out the module. It is impossible to do easily in the current framework. There are ways using nodeapi to send a email during node update of the proper type. It isn't hard but it is kinda outside the scope of this project.

Thanks
Robert

divbox’s picture

Robert,

No worries. I've got a solution working using rules, and sending out email on content creation. Does what I need perfectly.
Thanks!
div

rmiddle’s picture

Status: Active » Fixed

Status: Fixed » Closed (fixed)
Issue tags: -content_profile

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