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

Add enrollment email

parent ee1ea063
No related branches found
No related tags found
No related merge requests found
......@@ -55,7 +55,7 @@
{{/if}}
{{#if description}}
<div>
<small class="settings-description">{{description}}</small>
<small class="settings-description">{{{description}}}</small>
</div>
{{/if}}
</div>
......
......@@ -45,6 +45,8 @@
"Accounts_OAuth_Custom_Button_Label_Color" : "Button Text Color",
"Accounts_OAuth_Custom_Button_Color" : "Button Color",
"Accounts_RequireNameForSignUp" : "Require name for signup",
"Accounts_Enrollment_Email": "Enrollment E-mail",
"Accounts_Enrollment_Email_Description": "You may use [name], [fname], [lname] for the user's full name, first name or last name, respectively.<br />You may use [email] for the user's e-mail.",
"Activate" : "Activate",
"Add_custom_oauth" : "Add custom oauth",
"Add_Members" : "Add Members",
......@@ -453,4 +455,4 @@
"You_will_not_be_able_to_recover" : "You will not be able to recover this message!",
"Your_entry_has_been_deleted" : "Your entry has been deleted.",
"Your_Open_Source_solution" : "Your own Open Source chat solution"
}
\ No newline at end of file
}
......@@ -68,6 +68,7 @@ RocketChat.settings.add 'From_Email', 'no-reply@rocket.chat', { type: 'string',
RocketChat.settings.add 'Invitation_Subject', 'You have been invited to Rocket.Chat', { type: 'string', group: 'SMTP', section: 'Invitation' }
RocketChat.settings.add 'Invitation_HTML', '<h2>You have been invited to <h1>Rocket.Chat</h1></h2><p>Go to https://demo.rocket.chat and try the best open source chat solution available today!</p>', { type: 'string', multiline: true, group: 'SMTP', section: 'Invitation' }
RocketChat.settings.add 'Accounts_Enrollment_Email', '', { type: 'string', multiline: true, group: 'SMTP', section: 'Invitation' }
RocketChat.settings.addGroup 'Message'
RocketChat.settings.add 'Message_AllowEditing', true, { type: 'boolean', group: 'Message', public: true }
......
......@@ -27,6 +27,17 @@ Accounts.emailTemplates.resetPassword.text = (user, url) ->
url = url.replace Meteor.absoluteUrl(), Meteor.absoluteUrl() + 'login/'
verifyEmailText user, url
if RocketChat.settings.get 'Accounts_Enrollment_Email'
Accounts.emailTemplates.enrollAccount.text = (user, url) ->
text = RocketChat.settings.get 'Accounts_Enrollment_Email'
text = text.replace /\[name\]/g, user.name or ''
text = text.replace /\[fname\]/g, _.strLeft(user.name, ' ') or ''
text = text.replace /\[lname\]/g, _.strRightBack(user.name, ' ') or ''
text = text.replace /\[email\]/g, user.emails?[0]?.address or ''
return text
Accounts.onCreateUser (options, user) ->
# console.log 'onCreateUser ->',JSON.stringify arguments, null, ' '
# console.log 'options ->',JSON.stringify options, null, ' '
......
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