Notify new users about their login information

Another thing I would want to implement is, that when a new user has been
created, immediately after the creation the user should be informed via
email to his email-address about his login information like:

Hello xyz,

your user account has been created.

Login: xyz
Password: rt123

Please change your password soon.

Regards,
Support Team.

I dont know how to implement this.
Maybe with a Custom Condition “OnUserCreate” but I didnt find any specified
code snippets or examples.
Then the Custom action would be to parse the values of the form to get the
username and email-address.

But im quiet overstrained by that if you might see.

I would be glad for any tipps or tricks you can offer me.

Thx
Best regards,
Tommy.
View this message in context: http://www.nabble.com/Notify-new-users-about-their-login-information-tp23593299p23593299.html

One way to auto-assign a new user an account password is to do it via the
autoreply template, no new scrips needed. There’s a good example you can
start with on the wiki.

At 01:36 AM 5/18/2009, tommy0660 wrote:

Another thing I would want to implement is, that when a new user has been
created, immediately after the creation the user should be informed via
email to his email-address about his login information like:

Gene LeDuc, GSEC
Security Analyst
San Diego State University

Thanks for your answer.

I already set up the automatical creation of a username and password for new users, but thats not what i meant.

I mean, that if I AM CREATING a new user as an admin or root via the Users —> New User interface i dont want to manually inform this user (or more users) about their login information. If I click on “create”, the user should automatically get an email with the login information.

I cant solve that issue by any templates or existing scripts, because the condition “create”, which i used to inform new customers about their login information, refers to “create a ticket” and not “creat a user”. So actually I dont want to inform someone when he creates a ticket. I want to inform a supporter when i create his account.

Regards,
Tommy!

Gene LeDuc gleduc@mail.sdsu.edu 2009-05-18 17:23 >>>
One way to auto-assign a new user an account password is to do it via the
autoreply template, no new scrips needed. There’s a good example you can
start with on the wiki.

At 01:36 AM 5/18/2009, tommy0660 wrote:

Another thing I would want to implement is, that when a new user has been
created, immediately after the creation the user should be informed via
email to his email-address about his login information like:

Gene LeDuc, GSEC
Security Analyst
San Diego State University

Ah, didn’t realize you meant creating a user via the web. Poking around in
the database, I’d guess that something like the following might work as
your custom condition:

{ ### True when new user created via web
my $TA = $self->TransactionObj;
my $val = $TA->ObjectType eq ‘RT::User’
&& $TA->Type eq ‘Create’
&& $TA->CreatorObj->Id > != 1;
return $val;
}

I haven’t tried the above (or used ObjectType), but I think it’s at least a
good place to start. The following observations are for v3.6.3. When a
user is created via an e-mail ticket, the Creator is the System user, and
the System user is #1. When a user is created via a web session, the
Creator is the logged in user, which is always > #12. Set this up in a
global scrip and use a variant of the auto-password template you’re already
using for tickets. If it doesn’t work, throw some debug logging stuff in
and see what you get. Once you get it working, this would be a good wiki
addition!

Gene

At 08:29 AM 5/18/2009, Thomas Fluch wrote:

Thanks for your answer.

I already set up the automatical creation of a username and password for
new users, but thats not what i meant.

I mean, that if I AM CREATING a new user as an admin or root via the Users
→ New User interface i dont want to manually inform this user (or more
users) about their login information. If I click on “create”, the user
should automatically get an email with the login information.

I cant solve that issue by any templates or existing scripts, because the
condition “create”, which i used to inform new customers about their login
information, refers to “create a ticket” and not “creat a user”. So
actually I dont want to inform someone when he creates a ticket. I want to
inform a supporter when i create his account.

Regards,
Tommy!

Gene LeDuc gleduc@mail.sdsu.edu 2009-05-18 17:23 >>>
One way to auto-assign a new user an account password is to do it via the
autoreply template, no new scrips needed. There’s a good example you can
start with on the wiki.

At 01:36 AM 5/18/2009, tommy0660 wrote:

Another thing I would want to implement is, that when a new user has been
created, immediately after the creation the user should be informed via
email to his email-address about his login information like:


Gene LeDuc, GSEC
Security Analyst
San Diego State University

Gene LeDuc, GSEC
Security Analyst
San Diego State University

I attempted to add the following to my AutoReply template…

This ticket is owned by:

"{$Ticket->Owner()}"

Unfortunately, Owner() results in just the users ID (i.e. “63”) which is
meaningless to most folks. Instead, I’d like to include the owner’s
Name and/or email address. I do not see either in the “ACCEPTABLE
FIELDS” at Template Fields - Request Tracker Wiki.

Anyone know what it would be?

Thanks.

$Ticket->Owner is an object ID. Try these instead:

$Ticket->OwnerObj->RealName
$Ticket->OwnerObj->EmailAddress

At 09:46 AM 5/18/2009, Jeff Lucas wrote:

I attempted to add the following to my AutoReply template…

This ticket is owned by:

    "{$Ticket->Owner()}"

Unfortunately, Owner() results in just the users ID (i.e. “63”) which is
meaningless to most folks. Instead, I’d like to include the owner’s
Name and/or email address. I do not see either in the “ACCEPTABLE
FIELDS” at Template Fields - Request Tracker Wiki.

Gene LeDuc, GSEC
Security Analyst
San Diego State University

Hey Gene,

thank you for your example code!

You said, that you poked aroung in the database. I guess, that this database would help me a lot finding objects and their preferences I can use in a custom condition or custom action. Would you tell where i can find this database exactly so that i can try to understand perl a little?

Thank you!
Best regards, Tommy!

Gene LeDuc gleduc@mail.sdsu.edu 2009-05-18 18:39 >>>

Ah, didn’t realize you meant creating a user via the web. Poking around in
the database, I’d guess that something like the following might work as
your custom condition:

{ ### True when new user created via web
my $TA = $self->TransactionObj;
my $val = $TA->ObjectType eq ‘RT::User’
&& $TA->Type eq ‘Create’
&& $TA->CreatorObj->Id > != 1;
return $val;
}

I haven’t tried the above (or used ObjectType), but I think it’s at least a
good place to start. The following observations are for v3.6.3. When a
user is created via an e-mail ticket, the Creator is the System user, and
the System user is #1. When a user is created via a web session, the
Creator is the logged in user, which is always > #12. Set this up in a
global scrip and use a variant of the auto-password template you’re already
using for tickets. If it doesn’t work, throw some debug logging stuff in
and see what you get. Once you get it working, this would be a good wiki
addition!

Gene

At 08:29 AM 5/18/2009, Thomas Fluch wrote:

Thanks for your answer.

I already set up the automatical creation of a username and password for
new users, but thats not what i meant.

I mean, that if I AM CREATING a new user as an admin or root via the Users
→ New User interface i dont want to manually inform this user (or more
users) about their login information. If I click on “create”, the user
should automatically get an email with the login information.

I cant solve that issue by any templates or existing scripts, because the
condition “create”, which i used to inform new customers about their login
information, refers to “create a ticket” and not “creat a user”. So
actually I dont want to inform someone when he creates a ticket. I want to
inform a supporter when i create his account.

Regards,
Tommy!

Gene LeDuc gleduc@mail.sdsu.edu 2009-05-18 17:23 >>>
One way to auto-assign a new user an account password is to do it via the
autoreply template, no new scrips needed. There’s a good example you can
start with on the wiki.

At 01:36 AM 5/18/2009, tommy0660 wrote:

Another thing I would want to implement is, that when a new user has been
created, immediately after the creation the user should be informed via
email to his email-address about his login information like:


Gene LeDuc, GSEC
Security Analyst
San Diego State University

Gene LeDuc, GSEC
Security Analyst
San Diego State University

http://lists.bestpractical.com/cgi-bin/mailman/listinfo/rt-users

Community help: http://wiki.bestpractical.com
Commercial support: sales@bestpractical.com

Discover RT’s hidden secrets with RT Essentials from O’Reilly Media.
Buy a copy at http://rtbook.bestpractical.com

Hi Tommy,

The database is whatever database that was decided on when RT was
installed; it has nothing to do with perl. We use MySQL for our database
and I use Toad to do my snooping. I really can’t tell you anything about
your installation’s database or how to access it.

Here there be dragons, lad… Pretty much everyone agrees that accessing
the database directly, instead of letting RT do the grunt work, is not
generally a great idea. I did it because I wanted to understand what is
going on behind the scenes with RT. These observations have often been
helpful, but at other times have led me down the wrong path. You should
never modify the database directly.

Gene

At 11:09 AM 5/20/2009, Thomas Fluch wrote:

thank you for your example code!

You said, that you poked aroung in the database. I guess, that this
database would help me a lot finding objects and their preferences I can
use in a custom condition or custom action. Would you tell where i can
find this database exactly so that i can try to understand perl a little?

Thank you!
Best regards, Tommy!

Gene LeDuc gleduc@mail.sdsu.edu 2009-05-18 18:39 >>>
Ah, didn’t realize you meant creating a user via the web. Poking around in
the database, I’d guess that something like the following might work as
your custom condition:

{ ### True when new user created via web
my $TA = $self->TransactionObj;
my $val = $TA->ObjectType eq ‘RT::User’
&& $TA->Type eq ‘Create’
&& $TA->CreatorObj->Id > != 1;
return $val;
}

I haven’t tried the above (or used ObjectType), but I think it’s at least a
good place to start. The following observations are for v3.6.3. When a
user is created via an e-mail ticket, the Creator is the System user, and
the System user is #1. When a user is created via a web session, the
Creator is the logged in user, which is always > #12. Set this up in a
global scrip and use a variant of the auto-password template you’re already
using for tickets. If it doesn’t work, throw some debug logging stuff in
and see what you get. Once you get it working, this would be a good wiki
addition!

Gene LeDuc, GSEC
Security Analyst
San Diego State University

Hey Gene,

I know what you mean and I would never manually change something in the database or in the whole files of the RT installation since I didnt install it but im supposed to configure it via the interface.

What i actually thought that you mean is that there is one database which contains all objects (like queue, user, group, etc) and all preferences of them (user mail address, queue name, etc.). I thought that i then can enter this database and can have a look on all these preferences to (i.e.) find out what your code below actually should do :D… or how I can find out the queues a user is watcher of (regarding to another problem I floated). Because you wrote an example condition for me…after that condition I would have to do the same progress the template from the wiki does (creating a username, creating a password —> both for new users). But i cant access this scrip…so i have no idea how to find out what the code to generate a password and send it via email looks like.

But ok, i will try out something. I hope you understand that its a little bit hard without any perl knowledge and wihtout knowing all the objects and preferences RT uses and I theoretically could access.

I let you know, if i have a specific problem with my codes.

Thanks for your efforts.

best regards,
Tommy!

Gene LeDuc gleduc@mail.sdsu.edu 2009-05-20 20:35:43 >>>

Hi Tommy,

The database is whatever database that was decided on when RT was
installed; it has nothing to do with perl. We use MySQL for our database
and I use Toad to do my snooping. I really can’t tell you anything about
your installation’s database or how to access it.

Here there be dragons, lad… Pretty much everyone agrees that accessing
the database directly, instead of letting RT do the grunt work, is not
generally a great idea. I did it because I wanted to understand what is
going on behind the scenes with RT. These observations have often been
helpful, but at other times have led me down the wrong path. You should
never modify the database directly.

Gene

At 11:09 AM 5/20/2009, Thomas Fluch wrote:

thank you for your example code!

You said, that you poked aroung in the database. I guess, that this
database would help me a lot finding objects and their preferences I can
use in a custom condition or custom action. Would you tell where i can
find this database exactly so that i can try to understand perl a little?

Thank you!
Best regards, Tommy!

Gene LeDuc gleduc@mail.sdsu.edu 2009-05-18 18:39 >>>
Ah, didn’t realize you meant creating a user via the web. Poking around in
the database, I’d guess that something like the following might work as
your custom condition:

{ ### True when new user created via web
my $TA = $self->TransactionObj;
my $val = $TA->ObjectType eq ‘RT::User’
&& $TA->Type eq ‘Create’
&& $TA->CreatorObj->Id > != 1;
return $val;
}

I haven’t tried the above (or used ObjectType), but I think it’s at least a
good place to start. The following observations are for v3.6.3. When a
user is created via an e-mail ticket, the Creator is the System user, and
the System user is #1. When a user is created via a web session, the
Creator is the logged in user, which is always > #12. Set this up in a
global scrip and use a variant of the auto-password template you’re already
using for tickets. If it doesn’t work, throw some debug logging stuff in
and see what you get. Once you get it working, this would be a good wiki
addition!

Gene LeDuc, GSEC
Security Analyst
San Diego State University