Skip to content

Instantly share code, notes, and snippets.

@sunapi386
Created May 9, 2020 20:25
Show Gist options
  • Select an option

  • Save sunapi386/77f35b401694d312c289609b7d8d2abb to your computer and use it in GitHub Desktop.

Select an option

Save sunapi386/77f35b401694d312c289609b7d8d2abb to your computer and use it in GitHub Desktop.

Revisions

  1. sunapi386 created this gist May 9, 2020.
    8 changes: 8 additions & 0 deletions curl.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,8 @@

    curl -s --user 'api:key-YOURAPIKEYHERE' \
    https://api.mailgun.net/v3/mg.example.co/messages \
    -F from='Excited User <[email protected]>' \
    -F [email protected] \
    -F subject='Hello' \
    -F text='Testing some Mailgun awesomeness!'

    15 changes: 15 additions & 0 deletions typescript.tsx
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,15 @@
    import { NodeMailgun } from 'ts-mailgun';
    export const mgmailer = new NodeMailgun();
    mgmailer.apiKey = 'key-YOURAPIKEYHERE';
    mgmailer.domain = 'mg.example.co';
    mgmailer.fromEmail = '[email protected]';
    mgmailer.fromTitle = "Fancy Company";
    mgmailer.init();

    mgmailer.send('[email protected]', 'reset pass', 'reset-password?token=$').then((result) => {
    console.log("Done ", result )
    }).catch((error) => {
    console.log('Error:', error)
    })