Skip to content
Snippets Groups Projects
Commit 2b8524f9 authored by Marcelo Schmidt's avatar Marcelo Schmidt
Browse files

Send e-mail on first username set

parent 7fc68cd9
No related branches found
No related tags found
No related merge requests found
......@@ -16,6 +16,10 @@ RocketChat.setUsername = (user, username) ->
previousUsername = user.username
# If first time setting username, send Enrollment Email
if not previousUsername and RocketChat.settings.get 'Accounts_Enrollment_Email'
Accounts.sendEnrollmentEmail(user._id)
# Username is available; if coming from old username, update all references
if previousUsername
RocketChat.models.Messages.updateAllUsernamesByUserId user._id, username
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment