Skip to content
Snippets Groups Projects
Commit 153c112f authored by Jury Verrigni's avatar Jury Verrigni
Browse files

Using regular expressions instead of string for tag replace

parent 0c0ddc42
No related branches found
No related tags found
No related merge requests found
...@@ -35,7 +35,7 @@ Meteor.methods ...@@ -35,7 +35,7 @@ Meteor.methods
Accounts.emailTemplates.verifyEmail.subject = (userModel) -> Accounts.emailTemplates.verifyEmail.subject = (userModel) ->
return subject return subject
Accounts.emailTemplates.verifyEmail.html = (userModel, url) -> Accounts.emailTemplates.verifyEmail.html = (userModel, url) ->
return html.replace('[Verification_Url]', url); return html.replace(/\[Verification_Url]/g, url);
Accounts.sendVerificationEmail(userId, userData.email); Accounts.sendVerificationEmail(userId, userData.email);
catch error catch error
# throw new Meteor.Error 'error-email-send-failed', 'Error trying to send email: ' + error.message, { method: 'registerUser', message: error.message } # throw new Meteor.Error 'error-email-send-failed', 'Error trying to send email: ' + error.message, { method: 'registerUser', message: error.message }
......
...@@ -12,7 +12,7 @@ Meteor.methods ...@@ -12,7 +12,7 @@ Meteor.methods
Accounts.emailTemplates.verifyEmail.subject = (userModel) -> Accounts.emailTemplates.verifyEmail.subject = (userModel) ->
return subject return subject
Accounts.emailTemplates.verifyEmail.html = (userModel, url) -> Accounts.emailTemplates.verifyEmail.html = (userModel, url) ->
return html.replace('[Verification_Url]', url); return html.replace(/\[Verification_Url]/g, url);
try try
Accounts.sendVerificationEmail(user._id, s.trim(email)) Accounts.sendVerificationEmail(user._id, s.trim(email))
......
...@@ -19,7 +19,7 @@ Meteor.methods ...@@ -19,7 +19,7 @@ Meteor.methods
return subject return subject
Accounts.emailTemplates.resetPassword.html = (userModel, url) -> Accounts.emailTemplates.resetPassword.html = (userModel, url) ->
url = url.replace('/#/', '/'); url = url.replace('/#/', '/');
return html.replace('[Forgot_Password_Url]', url); return html.replace(/\[Forgot_Password_Url]/g, url);
try try
Accounts.sendResetPasswordEmail(user._id, email) Accounts.sendResetPasswordEmail(user._id, email)
......
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