Skip to content

TypeScript Error: Property 'connect' does not exist on type 'typeof Mailjet' in node-mailjet v6.x #284

@MamunCrafts

Description

@MamunCrafts

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions