replaced some console.errors with logger

This commit is contained in:
jackiettran
2026-01-10 20:47:29 -05:00
parent 86cb8b3fe0
commit 415bcc5021
15 changed files with 165 additions and 174 deletions

View File

@@ -1,5 +1,6 @@
const EmailClient = require("../core/EmailClient");
const TemplateManager = require("../core/TemplateManager");
const logger = require("../../../utils/logger");
/**
* UserEngagementEmailService handles user engagement emails
@@ -27,7 +28,7 @@ class UserEngagementEmailService {
]);
this.initialized = true;
console.log("User Engagement Email Service initialized successfully");
logger.info("User Engagement Email Service initialized successfully");
}
/**
@@ -68,7 +69,7 @@ class UserEngagementEmailService {
htmlContent
);
} catch (error) {
console.error("Failed to send first listing celebration email:", error);
logger.error("Failed to send first listing celebration email", { error });
return { success: false, error: error.message };
}
}
@@ -114,7 +115,7 @@ class UserEngagementEmailService {
htmlContent
);
} catch (error) {
console.error("Failed to send item deletion notification email:", error);
logger.error("Failed to send item deletion notification email", { error });
return { success: false, error: error.message };
}
}
@@ -158,14 +159,14 @@ class UserEngagementEmailService {
);
if (result.success) {
console.log(
`User banned notification email sent to ${bannedUser.email}`
);
logger.info("User banned notification email sent", {
email: bannedUser.email,
});
}
return result;
} catch (error) {
console.error("Failed to send user banned notification email:", error);
logger.error("Failed to send user banned notification email", { error });
return { success: false, error: error.message };
}
}