Skip to content
Snippets Groups Projects
Commit afb890f5 authored by Marcelo Schmidt's avatar Marcelo Schmidt Committed by Gabriel Engel
Browse files

Changes to Email settings (#3007)

parent 184bdbd9
No related merge requests found
...@@ -30,7 +30,7 @@ ...@@ -30,7 +30,7 @@
"Accounts_EmailVerification" : "Email Verification", "Accounts_EmailVerification" : "Email Verification",
"Accounts_EmailVerification_Description" : "Make sure you have correct SMTP settings to use this feature", "Accounts_EmailVerification_Description" : "Make sure you have correct SMTP settings to use this feature",
"Accounts_Enrollment_Email" : "Enrollment Email", "Accounts_Enrollment_Email" : "Enrollment Email",
"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 email.", "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_Iframe_api_method" : "Api Method", "Accounts_Iframe_api_method" : "Api Method",
"Accounts_Iframe_api_url" : "API URL", "Accounts_Iframe_api_url" : "API URL",
"Accounts_iframe_enabled" : "Enabled", "Accounts_iframe_enabled" : "Enabled",
...@@ -413,6 +413,7 @@ ...@@ -413,6 +413,7 @@
"Highlights_How_To" : "To be notified when someone mentions a word or phrase, add it here. You can separate words or phrases with commas. Highlight Words are not case sensitive.", "Highlights_How_To" : "To be notified when someone mentions a word or phrase, add it here. You can separate words or phrases with commas. Highlight Words are not case sensitive.",
"Highlights_List" : "Highlight words", "Highlights_List" : "Highlight words",
"History" : "History", "History" : "History",
"Host" : "Host",
"hours" : "hours", "hours" : "hours",
"How_friendly_was_the_chat_agent" : "How friendly was the chat agent?", "How_friendly_was_the_chat_agent" : "How friendly was the chat agent?",
"How_knowledgeable_was_the_chat_agent" : "How knowledgeable was the chat agent?", "How_knowledgeable_was_the_chat_agent" : "How knowledgeable was the chat agent?",
...@@ -464,6 +465,8 @@ ...@@ -464,6 +465,8 @@
"invisible" : "invisible", "invisible" : "invisible",
"Invisible" : "Invisible", "Invisible" : "Invisible",
"Invitation_HTML" : "Invitation HTML", "Invitation_HTML" : "Invitation HTML",
"Invitation_HTML_Description" : "You may use the following placeholders: <br /><ul><li>[email] for the recipient email.</li><li>[Site_Name] and [Site_URL] for the Application Name and URL respectively.</li></ul>",
"Invitation_HTML_Template" : "<h2>You have been invited to <h1>[Site_Name]</h1></h2><p>Go to [Site_URL] and try the best open source chat solution available today!</p>",
"Invitation_Subject" : "Invitation Subject", "Invitation_Subject" : "Invitation Subject",
"Invite_user_to_join_channel" : "Invite one user to join this channel", "Invite_user_to_join_channel" : "Invite one user to join this channel",
"Invite_Users" : "Invite Users", "Invite_Users" : "Invite Users",
...@@ -750,6 +753,7 @@ ...@@ -750,6 +753,7 @@
"Please_wait_while_OTR_is_being_established" : "Please wait while OTR is being established", "Please_wait_while_OTR_is_being_established" : "Please wait while OTR is being established",
"Please_wait_while_your_account_is_being_deleted" : "Please wait while your account is being deleted...", "Please_wait_while_your_account_is_being_deleted" : "Please wait while your account is being deleted...",
"Please_wait_while_your_profile_is_being_saved" : "Please wait while your profile is being saved...", "Please_wait_while_your_profile_is_being_saved" : "Please wait while your profile is being saved...",
"Port" : "Port",
"Post_as" : "Post as", "Post_as" : "Post as",
"Post_to_Channel" : "Post to Channel", "Post_to_Channel" : "Post to Channel",
"Post_to_s_as_s" : "Post to <strong>%s</strong> as <strong>%s</strong>", "Post_to_s_as_s" : "Post to <strong>%s</strong> as <strong>%s</strong>",
......
...@@ -104,22 +104,26 @@ RocketChat.settings.addGroup 'General', -> ...@@ -104,22 +104,26 @@ RocketChat.settings.addGroup 'General', ->
@add 'Desktop_Notifications_Duration', 0, { type: 'int', public: true, i18nDescription: 'Desktop_Notification_Durations_Description' } @add 'Desktop_Notifications_Duration', 0, { type: 'int', public: true, i18nDescription: 'Desktop_Notification_Durations_Description' }
RocketChat.settings.addGroup 'SMTP', -> RocketChat.settings.addGroup 'Email', ->
@add 'SMTP_Host', '', { type: 'string', env: true } @section 'SMTP', ->
@add 'SMTP_Port', '', { type: 'string', env: true } @add 'SMTP_Host', '', { type: 'string', env: true, i18nLabel: 'Host' }
@add 'SMTP_Username', '', { type: 'string', env: true } @add 'SMTP_Port', '', { type: 'string', env: true, i18nLabel: 'Port' }
@add 'SMTP_Password', '', { type: 'password', env: true } @add 'SMTP_Username', '', { type: 'string', env: true, i18nLabel: 'Username' }
@add 'From_Email', '', { type: 'string', placeholder: 'email@domain' } @add 'SMTP_Password', '', { type: 'password', env: true, i18nLabel: 'Password' }
@add 'SMTP_Test_Button', 'sendSMTPTestEmail', { type: 'action', actionText: 'Send_a_test_mail_to_my_user' } @add 'From_Email', '', { type: 'string', placeholder: 'email@domain' }
@add 'SMTP_Test_Button', 'sendSMTPTestEmail', { type: 'action', actionText: 'Send_a_test_mail_to_my_user' }
@section 'Invitation', -> @section 'Invitation', ->
@add 'Invitation_Subject', 'You have been invited to Rocket.Chat', { type: 'string' } @add 'Invitation_Subject', 'You have been invited to Rocket.Chat', { type: 'string', i18nLabel: 'Subject' }
@add 'Invitation_HTML', '<h2>You have been invited to <h1>Rocket.Chat</h1></h2><p>Go to ' + __meteor_runtime_config__?.ROOT_URL + ' and try the best open source chat solution available today!</p>', { type: 'string', multiline: true } @add 'Invitation_HTML', '', { type: 'code', code: 'text/html', multiline: true, i18nLabel: 'Body', i18nDescription: 'Invitation_HTML_Description' }
@add 'Accounts_Enrollment_Email', '', { type: 'string', multiline: true }
@section 'Registration', ->
@add 'Accounts_Enrollment_Email_Subject', '', { type: 'string', i18nLabel: 'Subject' }
@add 'Accounts_Enrollment_Email', '', { type: 'code', code: 'text/html', multiline: true, i18nLabel: 'Body', i18nDescription: 'Accounts_Enrollment_Email_Description' }
@section 'Registration via Admin', -> @section 'Registration via Admin', ->
@add 'Accounts_UserAddedEmail', '', { type: 'string', multiline: true, i18nLabel: 'Email', i18nDescription: 'Accounts_UserAddedEmail_Description' }
@add 'Accounts_UserAddedEmailSubject', '', { type: 'string', i18nLabel: "Subject" } @add 'Accounts_UserAddedEmailSubject', '', { type: 'string', i18nLabel: "Subject" }
@add 'Accounts_UserAddedEmail', '', { type: 'code', code: 'text/html', multiline: true, i18nLabel: 'Body', i18nDescription: 'Accounts_UserAddedEmail_Description' }
RocketChat.settings.addGroup 'Message', -> RocketChat.settings.addGroup 'Message', ->
......
...@@ -30,15 +30,19 @@ Accounts.emailTemplates.resetPassword.text = (user, url) -> ...@@ -30,15 +30,19 @@ Accounts.emailTemplates.resetPassword.text = (user, url) ->
url = url.replace /\/#\//, '/' url = url.replace /\/#\//, '/'
resetPasswordText user, url resetPasswordText user, url
if RocketChat.settings.get 'Accounts_Enrollment_Email_Subject'
Accounts.emailTemplates.enrollAccount.subject = (user) ->
return RocketChat.settings.get 'Accounts_Enrollment_Email_Subject'
if RocketChat.settings.get 'Accounts_Enrollment_Email' if RocketChat.settings.get 'Accounts_Enrollment_Email'
Accounts.emailTemplates.enrollAccount.text = (user, url) -> Accounts.emailTemplates.enrollAccount.text = (user, url) ->
text = RocketChat.settings.get 'Accounts_Enrollment_Email' text = RocketChat.settings.get 'Accounts_Enrollment_Email'
text = text.replace /\[name\]/g, user.name or '' text = text.replace /\[name\]/g, user.name or ''
text = text.replace /\[fname\]/g, _.strLeft(user.name, ' ') or '' text = text.replace /\[fname\]/g, _.strLeft(user.name, ' ') or ''
text = text.replace /\[lname\]/g, _.strRightBack(user.name, ' ') or '' text = text.replace /\[lname\]/g, _.strRightBack(user.name, ' ') or ''
text = text.replace /\[email\]/g, user.emails?[0]?.address or '' text = text.replace /\[email\]/g, user.emails?[0]?.address or ''
text = text.replace /\[Site_Name\]/g, RocketChat.settings.get("Site_Name") or ''
text = text.replace /\[Site_URL\]/g, RocketChat.settings.get("Site_Url") or ''
return text return text
Accounts.onCreateUser (options, user) -> Accounts.onCreateUser (options, user) ->
......
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