- Modified admin message to contain reason and user name

- Modified function placeholders to replace reason as well
- Modified email template on accounts.js
pull/7098/head
Luis Fernando do Nascimento 9 years ago
parent b10b887a93
commit 4248273f24
  1. 2
      packages/rocketchat-i18n/i18n/en.i18n.json
  2. 1
      packages/rocketchat-lib/lib/placeholders.js
  3. 8
      server/lib/accounts.js
  4. 4
      server/methods/registerUser.js

@ -42,7 +42,7 @@
"Accounts_Enrollment_Email_Default": "<h2>Welcome to <h1>[Site_Name]</h1></h2><p>Go to [Site_URL] and try the best open source chat solution available today!</p>",
"Accounts_Enrollment_Email_Description": "You may use the following placeholders: <br /><ul><li>[name], [fname], [lname] for the user's full name, first name or last name, respectively.</li><li>[email] for the user's email.</li><li>[Site_Name] and [Site_URL] for the Application Name and URL respectively.</li></ul>",
"Accounts_Enrollment_Email_Subject_Default": "Welcome to [Site_Name]",
"Accounts_Admin_Email_Approval_Needed_Default": "<p>An user with email <b>[email]</b> has been registered. <br>Please check Administration -> Users to activate or delete it.",
"Accounts_Admin_Email_Approval_Needed_Default": "<p>The user <b>[name] ([email])</b> has been registered.</p><p>Reason: <b>[reason]</b></p><p>Please check Administration -> Users to activate or delete it.</p>",
"Accounts_Admin_Email_Approval_Needed_Subject_Default": "A new user registered and needs approval",
"Accounts_ForgetUserSessionOnWindowClose": "Forget user session on window close",
"Accounts_Iframe_api_method": "Api Method",

@ -14,6 +14,7 @@ RocketChat.placeholders.replace = function(str, data) {
str = str.replace(/\[lname\]/g, _.strRightBack(data.name, ' ') || '');
str = str.replace(/\[email\]/g, data.email || '');
str = str.replace(/\[password\]/g, data.password || '');
str = str.replace(/\[reason\]/g, data.reason || '');
if (data.unsubscribe) {
str = str.replace(/\[unsubscribe\]/g, data.unsubscribe);

@ -65,7 +65,7 @@ Accounts.emailTemplates.notifyAdmin.subject = function() {
return `[${ siteName }] ${ subject }`;
};
Accounts.emailTemplates.notifyAdmin.html = function(user = {}) {
Accounts.emailTemplates.notifyAdmin.html = function(options = {}) {
let html;
@ -75,7 +75,9 @@ Accounts.emailTemplates.notifyAdmin.html = function(user = {}) {
const footer = RocketChat.placeholders.replace(RocketChat.settings.get('Email_Footer') || '');
html = RocketChat.placeholders.replace(html, {
email: user.emails[0].address
name: options.name,
email: options.email,
reason: options.reason
});
return header + html + footer;
@ -128,7 +130,7 @@ Accounts.onCreateUser(function(options, user = {}) {
to: destinations,
from: RocketChat.settings.get('From_Email'),
subject: Accounts.emailTemplates.notifyAdmin.subject(),
html: Accounts.emailTemplates.notifyAdmin.html(user)
html: Accounts.emailTemplates.notifyAdmin.html(options)
};
Meteor.defer(() => {

@ -32,7 +32,9 @@ Meteor.methods({
const userData = {
email: s.trim(formData.email.toLowerCase()),
password: formData.pass
password: formData.pass,
name: formData.name,
reason: formData.reason
};
// Check if user has already been imported and never logged in. If so, set password and let it through

Loading…
Cancel
Save