I'm currently specifying a migration plan from PostNuke 7.2.3 to Drupal 4.5 (actually, to Civicspace, at least until/unless I find a reason to use Drupal core). The one feature I haven't found an analogy for is user notification on approval.

Our current membership workflow is like this:

  1. User enrolls at the website.
  2. Enrollment goes into an approval queue.
  3. User gets an email notification that confirms their user name and password, and tells them they need to wait for approval before logging in.
  4. User attends a face to face meeting, which is recorded by somebody.
  5. Somebody with approval rights gets word that the queued user has attended; approves the member. This often entails changing the user's login name to conform to our standard ("FnameLname" -- it's a networking org, so people need to know one another on sight of UName).
  6. User gets a second confirmation message that re-confirms their user name.

It's that last step that's a problem, obviously; I haven't figured out a way to notify the users that they've been approved, and tell them what their new user name is.

My current thinking is that I will need to create a module that sends notification on block/unblock actions, or even whenever a user profile is edited; can anyone think of a simpler way? Is this wrong-headed thinking?

Comments

dschuetz’s picture

I've been wanting exactly this same functionality, and haven't seen any discussion on it (or maybe I'm not searching with the right strings).

What I think would work is something like this:

1. Add a new "variable" (right term?) for a "you've been approved" email template
2. Add the edit field for that new template the the appropriate admin page
3. Add a "Send approval email" button to the user edit page

As an option for #3, perhaps a checkbox next to the "active / blocked" radio button would be the way to automatically send the message. We could even extend this a little:

1.5 Add a "you've been blocked" template
2.5 Add the "blocked" template to the admin page [at some point, maybe a separate email template page might be necessary?]
3.5 Add "reason" field next to the "Send notification email" checkbox, then it can insert the reason into the template.

So, you might have a "welcome" template that sends a general welcome message (can we also get the userid / password included in this one, and drop it from the "pending approval" message?), then a "go away" template that might include a line where the "reason" gets dropped in. Which email gets sent depends on whether you block or unblock the user, and it only gets sent if you've checked the "send email" checkbox.

Heck, if we really wanted to get crazy, you could have a whole slew of user-definable templates, and you simply choose from a dropdown which template to use. "Welcome new user" or "blocked because of inactivity" or "blocked because of SPAM" or "deleted because I think you're a jerk" etc., etc.

For now, I'd settle for just the welcome template (hopefully with password reminder) and "send notification email" checkbox. I imagine this shouldn't be too difficult, but I don't want to go off on my own coding anything until I get some feedback that I'm not either reinventing a wheel or doing something incredibly stupid. (in which case, I'll just write my own darned module :) ).

xand’s picture

This issue has been brought up before, but there does not seem to be a solution. I'm actually looking for one too.

Feature Request:
http://drupal.org/node/1828

Issue:
http://drupal.org/node/5689

Posts:
http://drupal.org/node/1817
http://drupal.org/node/5671

Who wants to code? :D
---
www.symplification.com

dschuetz’s picture

Okay, I've just updated to 4.5.1 (which is tough considering I've already hacked some things up for global tab menus and taxonomy access control.... Is there an easy way to keep one's own hacks current while also merging with newer releases? or do people just sort of deal as it happens? I suppose I could put my own site under CVS and just merge with changes after releases, right? Anyway, that's a side topic that I'd love to hear more about, if anyone can point me to a good thread / discussion).

Anyway, I've just updated to 4.5.1. I'll do a patch to user.module that will do this:

  1. Add a "Send account activation email" checkbox near the "active / blocked" radio button
  2. Add a "Your account is now active" email template with associated edit box
  3. Recommend that the "Your account is created, pending approval" message be edited to remove the password, etc., information, and move that to the "now active" template
  4. Modify the "save user" routine to check for the "send email" checkbox. If that box is checked, and if the account is now marked as active, then it will:
    • Set a new password for the user
    • Compose an email from the "now active" template
    • Send it off

    (most of that code will be shamelessly copied from elsewhere, I forget where but I ran across it earlier today)

Does this seem like the right approach? It'll be a bit before I can get to it, but that's what I'll work towards. Who knows, I might even get it done tonight. :)

And then, once I've done this, how do I submit it for people to check it out, and then (assuming it's well liked and reasonably bugfree), how do we submit it as a patch to the main system? I'm sorta new to all this.

dschuetz’s picture

I've managed to hack something into shape, and it actually worked, wonder of wonders. I'm not really sure how to submit a patch for consideration, so I'll just enclose the .diff right here for the time being, though I'm sure it'll be a pain to extract back into a usable patch file. [hm.] Except that drupal wouldn't let me post it, 'cause it looked suspicious. I suppose that's a good thing.

Okay, I'll stick it out here: user_module.diff

I'm sure I've missed at least one really obvious thing, and I still would like to hear from people more involved with Drupal at the core level to see if this is even a Good Thing, so I wouldn't go trying to use this in production just yet. But I'd appreciate any testing, comments, suggestions, and even criticisms -- but be gentle, this is my first try. :)

david.

sepeck’s picture

http://drupal.org/node/316

Create a feature request (or find an open one about this issue) and attach the propsed patch. It will get lost here in the forums. Follow the comments on it to resubmit or whatever as the discussion on the patch evolves.

Happy contributing.

-Steven Peck
---------
Test site, always start with a test site.
Drupal Best Practices Guide

dschuetz’s picture

A preliminary patch has been submitted. Thanks, sepeck, for the pointer.

Attached to issue here: http://drupal.org/node/5689

xand’s picture

Also referencing the conversation at:

http://drupal.org/node/5689

I think implementation as a module might be a good idea, not because I doubt it's usefulness, but rather because it seems that very few drupal users are actively interested in this.

Even I might not be: my userbase is known, so i'm probably just going to mass import.

Hacks: I think one thing you definitely want to do is to note down what you did where. If you forget this, upgrading is a huge pain.

ferntree’s picture

Hi,

I'm following this thread with interest because this functionality is also something I want. In searching Drupal, I found this patch, but since I'm new to Drupal, I'm a little uncertain about whether this patch is valid any longer (esp since it is over a year old and might not apply to this version).

http://drupal.org/node/5060

It's not as sophisticated as the solution you've come up with, but it is certainly better than the default behavior. Does anyone know whether this patch could still be used with 4.6.2?

thanks