@@ -68,14 +68,14 @@ export class MonitoringAlerting {
6868 * Initialize alert channels based on configuration
6969 */
7070 private initializeAlertChannels ( ) : void {
71- // Only use email alerts for now - disable Slack and Discord
72- // if (this.alertConfig.slack_webhook) {
73- // this.alertChannels.push({
74- // type: 'slack',
75- // config: { webhook_url: this.alertConfig.slack_webhook },
76- // enabled: false // Disabled as requested
77- // });
78- // }
71+ // Slack integration enabled
72+ if ( this . alertConfig . slack_webhook ) {
73+ this . alertChannels . push ( {
74+ type : 'slack' ,
75+ config : { webhook_url : this . alertConfig . slack_webhook } ,
76+ enabled : true
77+ } ) ;
78+ }
7979
8080 // if (this.alertConfig.discord_webhook) {
8181 // this.alertChannels.push({
@@ -94,10 +94,10 @@ export class MonitoringAlerting {
9494 }
9595
9696 // Always enable email alerts with the default recipient
97- const emailRecipients = this . alertConfig . email_recipients && this . alertConfig . email_recipients . length > 0
98- ? this . alertConfig . email_recipients
97+ const emailRecipients = this . alertConfig . email_recipients && this . alertConfig . email_recipients . length > 0
98+ ? this . alertConfig . email_recipients
9999 : [ 'connect@codeunia.com' ] ;
100-
100+
101101 this . alertChannels . push ( {
102102 type : 'email' ,
103103 config : { recipients : emailRecipients } ,
@@ -158,7 +158,7 @@ export class MonitoringAlerting {
158158 }
159159
160160 // Check for high response times
161- const slowServices = results . checks . filter ( check =>
161+ const slowServices = results . checks . filter ( check =>
162162 check . responseTime > this . alertConfig . alert_thresholds . response_time_ms
163163 ) ;
164164 for ( const service of slowServices ) {
@@ -273,7 +273,7 @@ export class MonitoringAlerting {
273273 }
274274 } )
275275 }
276-
276+
277277 if ( process . env . NODE_ENV === 'development' ) {
278278 console . log ( `[ALERTING] ${ success ? 'SUCCESS' : 'FAILED' } - ${ channelType } :` , logEntry )
279279 } else {
@@ -462,7 +462,7 @@ export class MonitoringAlerting {
462462 */
463463 private async sendEmailAlert ( alert : Alert , config : Record < string , unknown > ) : Promise < void > {
464464 const emailRecipients = ( config . emailRecipients as string ) || process . env . ALERT_EMAIL_RECIPIENTS || 'connect@codeunia.com' ;
465-
465+
466466 const emailContent = {
467467 subject : `[${ alert . severity . toUpperCase ( ) } ] ${ alert . title } ` ,
468468 html : `
@@ -520,15 +520,15 @@ Codeunia Monitoring System
520520 if ( process . env . RESEND_API_KEY ) {
521521 const { Resend } = await import ( 'resend' ) ;
522522 const resend = new Resend ( process . env . RESEND_API_KEY ) ;
523-
523+
524524 await resend . emails . send ( {
525525 from : 'alerts@codeunia.com' ,
526526 to : emailRecipients ,
527527 subject : emailContent . subject ,
528528 html : emailContent . html ,
529529 text : emailContent . text
530530 } ) ;
531-
531+
532532 console . log ( `📧 Email alert sent to ${ emailRecipients } : ${ alert . title } ` ) ;
533533 } else {
534534 // Fallback to console log if Resend is not configured
0 commit comments