import { Injectable, InternalServerErrorException } from '@nestjs/common';
import Mailjet from 'node-mailjet';
import ejs from 'ejs';
import { welcomeMailTemplate } from '../templates/welcome';
@Injectable()
export class EmailService {
private readonly mailjet: any;
constructor() {
this.mailjet = Mailjet.connect( // here connect not working . i also try apiConnect
process.env.MJ_APIKEY_PUBLIC || 'your-api-key',
process.env.MJ_APIKEY_PRIVATE || 'your-api-secret'
);
}
// Other methods...
}
I am trying this . but this error is showing always
import { Injectable, InternalServerErrorException } from '@nestjs/common'; import Mailjet from 'node-mailjet'; import ejs from 'ejs'; import { welcomeMailTemplate } from '../templates/welcome';
@Injectable() export class EmailService { private readonly mailjet: any;
constructor() { this.mailjet = Mailjet.connect( // here connect not working . i also try apiConnect process.env.MJ_APIKEY_PUBLIC || 'your-api-key', process.env.MJ_APIKEY_PRIVATE || 'your-api-secret' ); }
// Other methods... } I am trying this . but this error is showing always