parse-server-mailgun-adapter-template
Advanced tools
Comparing version 1.1.6 to 1.1.7
16
index.js
@@ -28,7 +28,15 @@ | ||
function escapeRegExp(str) { | ||
return str.replace(/([.*+?^=!:${}()|\[\]\/\\])/g, "\\$1"); | ||
} | ||
function replaceAll(str, find, replace) { | ||
return str.replace(new RegExp(escapeRegExp(find), 'g'), replace); | ||
} | ||
function fillVariables(text, options) { | ||
text = text.replace("%username%", options.user.get("username")); | ||
text = text.replace("%email%", options.user.get("email")); | ||
text = text.replace("%appname%", options.appName); | ||
text = text.replace("%link%", options.link); | ||
text = replaceAll(text, "%username%", options.user.get("username")); | ||
text = replaceAll(text, "%email%", options.user.get("email")); | ||
text = replaceAll(text, "%appname%", options.appName); | ||
text = replaceAll(text, "%link%", options.link); | ||
return text; | ||
@@ -35,0 +43,0 @@ } |
{ | ||
"name": "parse-server-mailgun-adapter-template", | ||
"version": "1.1.6", | ||
"version": "1.1.7", | ||
"description": "Used to send Parse Server password reset and email verification emails though Mailgun", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
12461
179