diff --git a/static/admin/js/email-templates.js b/static/admin/js/email-templates.js index fc024bba..f413bfe7 100644 --- a/static/admin/js/email-templates.js +++ b/static/admin/js/email-templates.js @@ -7,6 +7,9 @@ * - Preview and test email sending */ +const emailTemplatesLog = window.LogConfig?.createLogger?.('emailTemplates') || + { info: () => {}, debug: () => {}, warn: () => {}, error: () => {} }; + function emailTemplatesPage() { return { // Data @@ -63,7 +66,7 @@ function emailTemplatesPage() { this.templates = templatesData.templates || []; this.categories = categoriesData.categories || []; } catch (error) { - console.error('Failed to load email templates:', error); + emailTemplatesLog.error('Failed to load email templates:', error); Utils.showToast('Failed to load templates', 'error'); } finally { this.loading = false; @@ -118,7 +121,7 @@ function emailTemplatesPage() { }; Utils.showToast(`No template for ${this.editLanguage.toUpperCase()} - create one by saving`, 'info'); } else { - console.error('Failed to load template:', error); + emailTemplatesLog.error('Failed to load template:', error); Utils.showToast('Failed to load template', 'error'); } } finally { @@ -156,7 +159,7 @@ function emailTemplatesPage() { // Refresh templates list await this.loadData(); } catch (error) { - console.error('Failed to save template:', error); + emailTemplatesLog.error('Failed to save template:', error); Utils.showToast(error.detail || 'Failed to save template', 'error'); } finally { this.saving = false; @@ -181,7 +184,7 @@ function emailTemplatesPage() { this.previewData = data; this.showPreviewModal = true; } catch (error) { - console.error('Failed to preview template:', error); + emailTemplatesLog.error('Failed to preview template:', error); Utils.showToast('Failed to load preview', 'error'); } }, @@ -251,7 +254,7 @@ function emailTemplatesPage() { Utils.showToast(result.message || 'Failed to send test email', 'error'); } } catch (error) { - console.error('Failed to send test email:', error); + emailTemplatesLog.error('Failed to send test email:', error); Utils.showToast('Failed to send test email', 'error'); } finally { this.sendingTest = false; diff --git a/static/vendor/js/email-templates.js b/static/vendor/js/email-templates.js index e96944f7..443325c3 100644 --- a/static/vendor/js/email-templates.js +++ b/static/vendor/js/email-templates.js @@ -7,7 +7,7 @@ const vendorEmailTemplatesLog = window.LogConfig?.loggers?.vendorEmailTemplates || window.LogConfig?.createLogger?.('vendorEmailTemplates', false) || - { info: () => {}, debug: () => {}, warn: () => {}, error: console.error }; + { info: () => {}, debug: () => {}, warn: () => {}, error: () => {} }; vendorEmailTemplatesLog.info('Loading...');