Send an e-mail when the administrator creates a new account for a user

RESOLVED FIXED in Bugzilla 5.0

Status

()

Bugzilla
Email Notifications
--
enhancement
RESOLVED FIXED
13 years ago
3 years ago

People

(Reporter: Troy D. Tyson, II, Assigned: Simon Green)

Tracking

unspecified
Bugzilla 5.0
Bug Flags:
approval +

Details

Attachments

(1 attachment, 3 obsolete attachments)

2.76 KB, patch
Frédéric Buclin
: review+
Details | Diff | Splinter Review
(Reporter)

Description

13 years ago
User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.5) Gecko/20041107 Firefox/1.0
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.5) Gecko/20041107 Firefox/1.0

New Feature Request - It would be helpful for an e-mail to be sent out to a new
user that is setup by the Bugzilla administrator.  The e-mail would be the same
as the current e-mail that is sent when a user signs up for the first time.

Reproducible: Always
Steps to Reproduce:
1.  Create a new user

Actual Results:  
An e-mail is not sent to the new user.

Expected Results:  
The system should send an e-mail to the new user.

Comment 1

13 years ago
there's no reason to do this as worded. the admin can use the standard form already.

admins are likely to setup accounts en mas, or to set them up as part of a new hire's packet, in which 
case they'd probably package the bugzilla entry into the email or printout they give the new hire.

Comment 2

13 years ago
As far as I read this bug, it says: "send email (to admins?) when the
permissions for an account are changed".

By "permissions for an account" I understand group membership, disabled text etc.
Status: UNCONFIRMED → NEW
Ever confirmed: true
OS: Windows 2000 → All
Hardware: PC → All
Summary: New Feature - Send an e-mail when the administrator creates a new account for a user. → Send an e-mail when the administrator creates a new account for a user
(Reporter)

Comment 3

13 years ago
(In reply to comment #2)
> As far as I read this bug, it says: "send email (to admins?) when the
> permissions for an account are changed".
> 
> By "permissions for an account" I understand group membership, disabled text etc.

The e-mail in question would be an e-mail to the "new user" that the Bugzilla
Administrator setup.  This e-mail would inform the "new user" that they are
setup in Bugzilla as well as their login information.  This would be useful for
administrators that are installing Bugzilla into an existing work stream.
Reassigning bugs that I'm not actively working on to the default component owner
in order to try to make some sanity out of my personal buglist.  This doesn't
mean the bug isn't being dealt with, just that I'm not the one doing it.  If you
are dealing with this bug, please assign it to yourself.
Assignee: justdave → email-notifications
QA Contact: mattyt-bugzilla → default-qa

Comment 5

13 years ago
I'd like to see this supported.  If anything, whenever the admin changes the
password from the editusers.cgi form, bugzilla ought to email the new password.
Moreover, the current setup is somewhat confusing as the passwordmail parameter
implies an email would be sent if the password got changed. 

And in my situation, I would like to see an email go out when creating a new
account as well, for the same reason as comment #3.  

Comment 6

13 years ago
Created attachment 190040 [details] [diff] [review]
v1

Enclosed is a simple patch.  Don't know if we want to make this optional.
Attachment #190040 - Flags: review?(wurblzap)
Comment on attachment 190040 [details] [diff] [review]
v1

If at all, then I think this should be an option... Whenever there is
createemailregexp set to .*, I use createaccount.cgi to create user accounts,
and I urge users to take responsibility for their passwords themselves anyway
and to change them on their own. In both cases, e-mails are sent. In my little
world, creating a user or changing a password by way of editusers.cgi is then a
useful tool for doing changes silently, without an e-mail.

As I tend to WONTFIX this, please ask review from somebody else ;)
Attachment #190040 - Flags: review?(wurblzap) → review?
It would make good UI sense to allow this, but have a checkbox on the form
(which is not selected by default) for "email this user their account
information" in editusers.cgi.  The mail would only get sent if the box is checked.

Mailman and Majordomo both have this in their web interfaces (there's a checkbox
or a radio button next to the edit box where you paste the addresses of new list
members in for whether or not to mail them the "thanks for subscribing, here's
how to use the list" email).

Comment 9

13 years ago
Comment on attachment 190040 [details] [diff] [review]
v1

r- per justdave's comment 8.
Attachment #190040 - Flags: review? → review-

Comment 10

12 years ago
*** Bug 341515 has been marked as a duplicate of this bug. ***

Comment 11

7 years ago
Created attachment 504409 [details] [diff] [review]
User Notification
Attachment #504409 - Flags: review?(LpSolit)

Comment 12

7 years ago
Comment on attachment 504409 [details] [diff] [review]
User Notification

This bug is about sending an email when a new account has been created, not about sending an email when changes have been made. I'm not a fan to send the password by email, unencrypted. Bugzilla stopped doing this for a long time. Maybe a link to change the password would be better, as it's best practice to change the password set by the admin anyway.
Attachment #504409 - Flags: review?(LpSolit) → review-

Comment 13

7 years ago
Well, If an admin can create a password for a user then the password set got to be relaid to the use in question, otherwise what is the point in giving ability to create/change a password

Updated

7 years ago
Duplicate of this bug: 468794
(Assignee)

Comment 15

5 years ago
Created attachment 686537 [details] [diff] [review]
patch to fix this problem

Note that this patch will show the notify link on user updates too. I will submit a patch for bug 622811 if this is accepted to send notifications on user changes.

Regards,
Hugo
Attachment #686537 - Flags: review?
(Assignee)

Comment 16

5 years ago
Should the e-mail mention the user that did the change? I can create an updated patch if that information is desired. The previous patch did not have this information.

Comment 17

5 years ago
(In reply to Hugo from comment #16)
> Should the e-mail mention the user that did the change?

This is not needed, no. Not even desired, IMO.
Assignee: email-notifications → hugo.seabrook
Status: NEW → ASSIGNED
Keywords: relnote
Target Milestone: --- → Bugzilla 5.0
(Assignee)

Updated

5 years ago
Attachment #686537 - Flags: review? → review?(LpSolit)

Updated

5 years ago
Attachment #190040 - Attachment is obsolete: true

Updated

5 years ago
Attachment #504409 - Attachment is obsolete: true

Comment 18

5 years ago
Comment on attachment 686537 [details] [diff] [review]
patch to fix this problem

>=== modified file 'editusers.cgi'

>+my $notify_user    = $cgi->param('notify_user');

This is not a "common" CGI parameter. It should be moved where it's really used, i.e. in the |$action eq "new"| block.


>+    if ($new_user->is_enabled && $notify_user) {
>+      $vars->{'new_user'} = $new_user;
>+      my $message;
>+      
>+      $template->process('email/new-user-details.txt.tmpl', $vars, \$message)
>+        || ThrowTemplateError($template->error());
>+      MessageToMTA($message);
>+    }

Please fix the indentation. 4 whitespaces in CGI scripts.



>=== modified file 'template/en/default/admin/users/userdata.html.tmpl'

>+    <th><label for="notify_user">Notify User:</label></th>
>+    <td>
>+      <input type="checkbox" name="notify_user" id="notify_user" value="1" checked />

Several things:
- This checkbox should be unchecked by default, as said in comment 8.
- Write > instead of />. This is not part of the doctype used by Bugzilla (HTML 4.01 Transitional).
- This checkbox must not be displayed when editing existing user accounts. It must only appear when creating a new user account.



>=== added file 'template/en/default/email/new-user-details.txt.tmpl'

>+[% PROCESS "global/variables.none.tmpl" %]

This template is already loaded by Template.pm. No need to call it ourselves.


Otherwise looks good.
Attachment #686537 - Flags: review?(LpSolit) → review-
(Assignee)

Comment 19

5 years ago
Created attachment 696924 [details] [diff] [review]
v2 patch
Attachment #686537 - Attachment is obsolete: true
Attachment #696924 - Flags: review?(LpSolit)

Comment 20

5 years ago
Comment on attachment 696924 [details] [diff] [review]
v2 patch

>=== modified file 'editusers.cgi'

>+    # Send mail if user is NOT disabled
>+    if ($new_user->is_enabled && $cgi->param('notify_user')) {

Thinking about it a bit more, there is no reason to not send a notification if the admin decided to do so despite the account is disabled. Moreover, there is nothing in the UI which says anything about this, and so the admin may check this checkbox and wonder why no notification has been sent. So let's drop this limitation.



>=== modified file 'template/en/default/admin/users/userdata.html.tmpl'

>+      (email this user their account information, but not their password)

Maybe reword it as: email this user their account information (the password will not be included).

Your original text makes me think that you have to check this checkbox to not send the password, else the password will be sent.



>=== added file 'template/en/default/email/new-user-details.txt.tmpl'

>+A new [% terms.Bugzilla %] user account created at [% urlbase %]:

... has been created ...


>+If the above details are incorrect, or you have any other issues regarding
>+your account, please contact administration at [% Param('maintainer') %].

I'm not sure which details could be incorrect. If the email address is wrong, then you won't get the email as it won't point to your inbox. If the real name is incorrect, there is no need to contact administrators; the user can edit it himself. Maybe drop the first part of the sentence.


Otherwise works fine. r=LpSolit with these comments addressed on checkin.
Attachment #696924 - Flags: review?(LpSolit) → review+

Updated

5 years ago
Flags: approval+

Comment 21

5 years ago
Committing to: bzr+ssh://lpsolit%40gmail.com@bzr.mozilla.org/bugzilla/trunk/
modified editusers.cgi
modified template/en/default/admin/users/userdata.html.tmpl
added template/en/default/email/new-user-details.txt.tmpl
Committed revision 8564.
Status: ASSIGNED → RESOLVED
Last Resolved: 5 years ago
Resolution: --- → FIXED

Comment 22

3 years ago
Added to relnotes for 5.0rc1.
Keywords: relnote
You need to log in before you can comment on or make changes to this bug.