fixed mail service
This commit is contained in:
		@@ -10,7 +10,7 @@ export default class Mail{
 | 
			
		||||
  static mailPass: string;
 | 
			
		||||
 | 
			
		||||
  static init() {
 | 
			
		||||
    this.mailPass = Array(64).map(() => Math.floor(Math.random() * 10)).join('');
 | 
			
		||||
    this.mailPass = Array(64).fill(0).map(() => Math.floor(Math.random() * 10)).join('');
 | 
			
		||||
    this.uri = JSON.parse(process.env.VCAP_SERVICES).Mail[0].credentials.uri;
 | 
			
		||||
    this.auth.username = JSON.parse(process.env.VCAP_SERVICES).Mail[0].credentials.username;
 | 
			
		||||
    this.auth.password = JSON.parse(process.env.VCAP_SERVICES).Mail[0].credentials.password;
 | 
			
		||||
@@ -48,6 +48,7 @@ export default class Mail{
 | 
			
		||||
        auth: this.auth
 | 
			
		||||
      });
 | 
			
		||||
    }).then(() => {  // init done successfully
 | 
			
		||||
      console.info('Mail service established successfully');
 | 
			
		||||
      this.send('lukas.veit@bosch.com', 'Mail Service started', new Date().toString());
 | 
			
		||||
    }).catch(err => {  // anywhere an error occurred
 | 
			
		||||
      console.error(`Mail init error: ${err.request.method} ${err.request.path}: ${err.response.status}`,
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user