@ -21,19 +21,23 @@ class SMTP extends NotificationProvider { 
			
		
	
		
			
				
					                pass :  notification . smtpPassword ,  
			
		
	
		
			
				
					            } ;  
			
		
	
		
			
				
					        }  
			
		
	
		
			
				
					        // Lets start with default subject
  
			
		
	
		
			
				
					        // Lets start with default subject and empty string for custom one 
  
			
		
	
		
			
				
					        let  subject  =  msg ;  
			
		
	
		
			
				
					        let  customSubject  =  "" ;  
			
		
	
		
			
				
					
 
			
		
	
		
			
				
					        // Our subject cannot end with whitespace it's often raise spam score
  
			
		
	
		
			
				
					        let  customsubject  =  notification . customsubject . trim ( )  
			
		
	
		
			
				
					        // Once I got "Cannot read property 'trim' of undefined", better be safe than sorry
  
			
		
	
		
			
				
					        if  ( notification . customSubject )  {  
			
		
	
		
			
				
					            customSubject  =  notification . customSubject . trim ( )  
			
		
	
		
			
				
					        }  
			
		
	
		
			
				
					
 
			
		
	
		
			
				
					        // If custom subject is not empty, change subject for notification
  
			
		
	
		
			
				
					        if  ( customsubject  !==  "" )  {  
			
		
	
		
			
				
					        if  ( customS ubject  !==  "" )  {  
			
		
	
		
			
				
					
 
			
		
	
		
			
				
					            // Replace "MACROS" with coresponding variable
  
			
		
	
		
			
				
					            let  replaceName  =  new  RegExp ( "{NAME}" ,  "g" ) ;  
			
		
	
		
			
				
					            let  replaceHostname  =  new  RegExp ( "{HOSTNAME}" ,  "g" ) ;  
			
		
	
		
			
				
					            let  replaceStatus  =  new  RegExp ( "{STATUS}" ,  "g" ) ;  
			
		
	
		
			
				
					            let  replaceName  =  new  RegExp ( "{{ NAME} }" ,  "g" ) ;  
			
		
	
		
			
				
					            let  replaceHostname  =  new  RegExp ( "{{ HOSTNAME} }" ,  "g" ) ;  
			
		
	
		
			
				
					            let  replaceStatus  =  new  RegExp ( "{{ STATUS} }" ,  "g" ) ;  
			
		
	
		
			
				
					
 
			
		
	
		
			
				
					            // Lets start with dummy values to simplify code
  
			
		
	
		
			
				
					            let  monitorName  =  "Test"  
			
		
	
	
		
			
				
					
						
						
						
							
								 
						
					 
				
				@ -50,11 +54,11 @@ class SMTP extends NotificationProvider { 
			
		
	
		
			
				
					            }  
			
		
	
		
			
				
					             
			
		
	
		
			
				
					            // Break replace to one by line for better readability
  
			
		
	
		
			
				
					            customsubject  =  customs ubject . replace ( replaceStatus ,  serviceStatus ) ;  
			
		
	
		
			
				
					            customsubject  =  customs ubject . replace ( replaceName ,  monitorName ) ;  
			
		
	
		
			
				
					            customsubject  =  customs ubject . replace ( replaceHostname ,  monitorHostname ) ;  
			
		
	
		
			
				
					            customSubject  =  customS ubject . replace ( replaceStatus ,  serviceStatus ) ;  
			
		
	
		
			
				
					            customSubject  =  customS ubject . replace ( replaceName ,  monitorName ) ;  
			
		
	
		
			
				
					            customSubject  =  customS ubject . replace ( replaceHostname ,  monitorHostname ) ;  
			
		
	
		
			
				
					
 
			
		
	
		
			
				
					            subject  =  customs ubject  
			
		
	
		
			
				
					            subject  =  customS ubject  
			
		
	
		
			
				
					        }  
			
		
	
		
			
				
					
 
			
		
	
		
			
				
					        let  transporter  =  nodemailer . createTransport ( config ) ;