File size: 687 Bytes
db3d93b
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
import { ConfigService } from '@nestjs/config';

export class EmailConfig {
  apiKey: string;
  otpEmail: string;
  otpTemplateId: number;
  welcomeEmail: string;
  welcomeTemplateId: number;

  constructor(configService: ConfigService) {
    this.apiKey = configService.get<string>('BREVO_API_KEY') || '';
    this.otpEmail = configService.get<string>('BREVO_OTP_EMAIL') || '';
    this.otpTemplateId = parseInt(
      configService.get<string>('BREVO_OTP_TEMPLATE_ID') || '0',
    );
    this.welcomeEmail = configService.get<string>('BREVO_WELCOME_EMAIL') || '';
    this.welcomeTemplateId = parseInt(
      configService.get<string>('BREVO_WELCOME_TEMPLATE_ID') || '0',
    );
  }
}