Use load email config util
This commit is contained in:
@@ -11,8 +11,7 @@
|
||||
function initEmailScript() {
|
||||
logToConsole(LOG_DEBUG, "[Asshat.Email]: Initializing email script ...");
|
||||
|
||||
let emailConfigFile = loadTextFile("config/email.json");
|
||||
emailConfig = JSON.parse(emailConfigFile);
|
||||
emailConfig = loadEmailConfiguration();
|
||||
|
||||
logToConsole(LOG_DEBUG, "[Asshat.Email]: Email script initialized successfully!");
|
||||
}
|
||||
@@ -34,4 +33,11 @@ function sendEmail(toEmail, toName, subject, body) {
|
||||
emailConfig.fromName);
|
||||
}
|
||||
|
||||
// -------------------------------------------------------------------------
|
||||
|
||||
function loadEmailConfiguration() {
|
||||
let emailConfigFile = loadTextFile("config/email.json");
|
||||
return JSON.parse(emailConfigFile);
|
||||
}
|
||||
|
||||
// -------------------------------------------------------------------------
|
||||
Reference in New Issue
Block a user