Hi,
Thank you for this package.
Do you have plans to migrate this module to mailgun.js 4.x?
I have some troubles to use the following function:
this.mailgunService.validateEmail(email)
I'm receiving a Forbidden error
[Nest] 9148 - 11/01/2022, 11:53:55 ERROR [ExceptionsHandler] Forbidden
Moreover, in the lastest branch, the return changed from
validateEmail: (email: string) => Promise<{
address: string;
did_you_mean: string;
is_valid: boolean;
parts: {
display_name: string;
domain: string;
local_part: string;
};
}>;
to
export interface ValidationResult {
address: string;
is_disposable_address: boolean;
is_role_address: boolean;
reason: string[];
result: string;
risk: string;
}
And I'm very interested with is_disposable_address
field.
The only other function I'm using, createEmail
is working perfectly fine! Example below:
async loadNewAccountTemplate(account: Account) {
const url = `${this.configService.get<string>('MAILGUN_ENV_DEPLOYED')}/confirm-account`
const token = await this.confirmService.generateToken(account)
const mailgunData: EmailOptions = {
from: 'Contact <[email protected]>',
to: account.email,
subject: `Please confirm`,
template: 'new-account',
'h:X-Mailgun-Variables': JSON.stringify({ url, email: encodeURIComponent(account.email), token })
}
return await this.mailgunService.createEmail(this.configService.get<string>('MAILGUN_DOMAIN'), mailgunData)
}