diff --git a/client/views/admin/admin.html b/client/views/admin/admin.html index 36d96f01d31..bb87193a709 100644 --- a/client/views/admin/admin.html +++ b/client/views/admin/admin.html @@ -55,7 +55,7 @@ {{/if}} {{#if description}}
Go to https://demo.rocket.chat and try the best open source chat solution available today!
', { 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 } diff --git a/server/lib/accounts.coffee b/server/lib/accounts.coffee index 23047777530..eb0878f6cfc 100644 --- a/server/lib/accounts.coffee +++ b/server/lib/accounts.coffee @@ -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, ' '