Replace placeholder in email body with servername

This commit is contained in:
Vortrex
2021-06-28 16:35:22 -05:00
parent 37f954d3ea
commit dfcf5cd276

View File

@@ -921,7 +921,7 @@ function initClient(client) {
showPlayerLoginGUI(client); showPlayerLoginGUI(client);
} else { } else {
logToConsole(LOG_DEBUG, `[VRR.Account] ${getPlayerDisplayForConsole(client)} is being shown the login message (GUI disabled).`); logToConsole(LOG_DEBUG, `[VRR.Account] ${getPlayerDisplayForConsole(client)} is being shown the login message (GUI disabled).`);
messagePlayerNormal(client, `Welcome back to Asshat Gaming RP, ${getPlayerName(client)}! Please /login to continue.`, getColourByName("softGreen")); messagePlayerNormal(client, `Welcome back to ${getServerName()}, ${getPlayerName(client)}! Please /login to continue.`, getColourByName("softGreen"));
} }
} }
} else { } else {
@@ -930,7 +930,7 @@ function initClient(client) {
showPlayerRegistrationGUI(client); showPlayerRegistrationGUI(client);
} else { } else {
logToConsole(LOG_DEBUG, `[VRR.Account] ${getPlayerDisplayForConsole(client)} is being shown the register message (GUI disabled).`); logToConsole(LOG_DEBUG, `[VRR.Account] ${getPlayerDisplayForConsole(client)} is being shown the register message (GUI disabled).`);
messagePlayerNormal(client, `Welcome to Asshat Gaming RP, ${getPlayerName(client)}! Please /register to continue.`, getColourByName("softGreen")); messagePlayerNormal(client, `Welcome to ${getServerName()}, ${getPlayerName(client)}! Please /register to continue.`, getColourByName("softGreen"));
} }
} }
} }
@@ -1180,8 +1180,9 @@ function generateEmailVerificationCode() {
function sendEmailVerificationEmail(client, emailVerificationCode) { function sendEmailVerificationEmail(client, emailVerificationCode) {
let emailBodyText = getEmailConfig().bodyContent.confirmEmail; let emailBodyText = getEmailConfig().bodyContent.confirmEmail;
emailBodyText = emailBodyText.replace("{VERIFICATIONCODE}", emailVerificationCode); emailBodyText = emailBodyText.replace("{VERIFICATIONCODE}", emailVerificationCode);
emailBodyText = emailBodyText.replace("{SERVERNAME}", getServerName());
sendEmail(getPlayerData(client).accountData.emailAddress, getPlayerData(client).accountData.name, `Confirm email on Asshat Gaming RP`, emailBodyText); sendEmail(getPlayerData(client).accountData.emailAddress, getPlayerData(client).accountData.name, `Confirm email on ${getServerName()}`, emailBodyText);
} }
// =========================================================================== // ===========================================================================
@@ -1191,8 +1192,9 @@ function verifyAccountEmail(accountData, verificationCode) {
let emailBodyText = getEmailConfig().bodyContent.confirmEmail; let emailBodyText = getEmailConfig().bodyContent.confirmEmail;
emailBodyText = emailBodyText.replace("{VERIFICATIONCODE}", emailVerificationCode); emailBodyText = emailBodyText.replace("{VERIFICATIONCODE}", emailVerificationCode);
emailBodyText = emailBodyText.replace("{SERVERNAME}", getServerName());
sendEmail(getPlayerData(client).accountData.emailAddress, getPlayerData(client).accountData.name, `Confirm email on Asshat Gaming RP`, emailBodyText); sendEmail(getPlayerData(client).accountData.emailAddress, getPlayerData(client).accountData.name, `Confirm email on ${getServerName()}`, emailBodyText);
getPlayerData(client).accountData.emailAddress = emailAddress; getPlayerData(client).accountData.emailAddress = emailAddress;
getPlayerData(client).accountData.emailVerificationCode = module.hashing.sha512(emailVerificationCode); getPlayerData(client).accountData.emailVerificationCode = module.hashing.sha512(emailVerificationCode);