Giter Site home page Giter Site logo

nextnc / nestjs-mailgun Goto Github PK

View Code? Open in Web Editor NEW
26.0 26.0 20.0 462 KB

This is a simple wrapper of mailgun-js. It only comtemplates the send email and verify email functionalities, but later more it will be added. Just ping me or open pull request and contribute :)

License: MIT License

TypeScript 100.00%

nestjs-mailgun's People

Contributors

dependabot[bot] avatar dmeents avatar edskeizer avatar elethynh avatar kkarimi avatar nextnc avatar noorhasanalsayed avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

nestjs-mailgun's Issues

Missing option for MailGun host

Hi there!
There is no option for custom MailGun host, which is needed by their API docs:
https://documentation.mailgun.com/en/latest/quickstart-sending.html#send-via-api
"NOTE: If you’re sending from our EU infrastructure, be sure to substitute our EU endpoint in the above example: https://api.eu.mailgun.net/v3"

and so there is
mailgun-js constructor (options) {
this.host = options.host || 'api.mailgun.net'

but inside you package there is no such option to set

Thats why it useless if sending domain is in EU zone

Send email returned value

I'm using this library for a project.
I found out that the method sendEmail returns a boolean promise.
However, the method resolves a body object.
Is it an error?

MailgunModule.forAsyncRoot

Hi!

It would be nice to hace async registration.

Also in ConfigurationMailgun I think it's misspelled AKI_KEY, it should bi API_KEY.

Regards

Can't pass custom data to template

Hello,

From your documentation I don't see an option to pass custom variables.
In my templates I use a var like {{name}}.
I tried using "recipient-variables" like this, but it doesn't work for me.
{
name: 'My name'
}

If it is possible, an example will be appreciated!

With kind regards,
Andy

Update mailgun.js to 4.x branch

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)
  }

several high vulnerabilities CVE-2021-28918,CVE-2021-29418 are introduced in @nextnm/nestjs-mailgun

Hi, several high vulnerabilities CVE-2021-28918,CVE-2021-29418 are introduced in @nextnm/nestjs-mailgun via:
● @nextnm/[email protected][email protected][email protected][email protected][email protected][email protected]

mailgun-js is a legacy package. It has not been maintained for about 2 years, and is not likely to be updated.
Is it possible to migrate mailgun-js to other package to remediate this vulnerability?

I noticed several migration records for mailgun-js in other js repos, such as

in boba-watch, version 2.0.0, migrate from mailgun-js to mailgun.js via commit

Are there any efforts planned that would remediate this vulnerability or migrate mailgun-js?

Thanks
; )

typo in readme

in examples @nextm/nestjs-mailgun -> @nextnm/nestjs-mailgun

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.