The communications platform that puts data protection first.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Rocket.Chat/packages/rocketchat-lib/lib/placeholders.js

21 lines
617 B

RocketChat.placeholders = {};
RocketChat.placeholders.replace = function(str, data) {
if (!str) {
return "";
}
str = str.replace(/\[Site_Name\]/g, RocketChat.settings.get("Site_Name") || '');
str = str.replace(/\[Site_URL\]/g, RocketChat.settings.get("Site_Url") || '');
if (data) {
str = str.replace(/\[name\]/g, data.name || '');
str = str.replace(/\[fname\]/g, _.strLeft(data.name, ' ') || '');
str = str.replace(/\[lname\]/g, _.strRightBack(data.name, ' ') || '');
str = str.replace(/\[email\]/g, data.email || '');
str = str.replace(/\[password\]/g, data.password || '');
}
return str;
};