0.7.0-alpha.1 • Published 3 months ago

@flink-app/email-plugin v0.7.0-alpha.1

Weekly downloads
-
License
MIT
Repository
-
Last release
3 months ago

Flink API Docs

A FLINK plugin that makes it possible to send email.

Usage

Install plugin to your flink app project:

npm i -S @flink-app/email-plugin

Setup

With Sendgrid

Add and configure plugin in your app startup (probable the index.ts in root project):

import { emailPlugin, sendgridClient } from "@flink-app/email-plugin";

function start() {
  new FlinkApp<AppContext>({
    name: "My app",
    plugins: [
        // Register plugin
        emailPlugin({
          client : new sendgridClient({
            apiKey : process.env.SENDGRID_API_KEY
          })
        })
    ],
  }).start();
}

Add plugin ctx to Ctx.ts in root project

import { emailPluginContext } from "@flink-app/email-plugin";

export interface Ctx extends FlinkContext<emailPluginContext> {

}

With SMTP

Add and configure plugin in your app startup (probable the index.ts in root project):

import { emailPlugin, smtpClient } from "@flink-app/email-plugin";

function start() {
  new FlinkApp<AppContext>({
    name: "My app",
    plugins: [
        // Register plugin
        emailPlugin({
          client : new smtpClient({
            host: "XYZ",
            port: 587,
            secure: false
            auth: {
              user: "user"
              pass: "pass"
            },
          })
        })
    ],
  }).start();
}

Add plugin ctx to Ctx.ts in root project

import { emailPluginContext } from "@flink-app/email-plugin";

export interface Ctx extends FlinkContext<emailPluginContext> {

}

Send email

Send email from your handlers by using the the context

 await ctx.plugins.emailPlugin.client.send({
    from : "from@xxx.com",
    to : ["to@yyy.com"],
    subject : "Hello world",
    text : "Hello world",  //Eiter text or html must be specified
    html : "Hello <b>world</b>"
  })
0.7.0-alpha.1

3 months ago

0.7.0-alpha.0

10 months ago

0.6.5

6 months ago

0.5.0

1 year ago

0.6.0

1 year ago

0.4.7

1 year ago

0.4.5

1 year ago

0.4.6

1 year ago

0.3.12

1 year ago

0.4.4

1 year ago

0.4.1

1 year ago

0.4.0

1 year ago

0.4.2

1 year ago

0.3.11

1 year ago

0.3.8

2 years ago

0.3.7

2 years ago

0.3.6

2 years ago

0.3.0

2 years ago

0.2.0-beta.15

3 years ago

0.2.0-beta.14

3 years ago

0.2.0-beta.12

3 years ago

0.2.0-beta.11

3 years ago

0.2.0-beta.10

3 years ago

0.2.0-beta.9

3 years ago

0.2.0-beta.8

3 years ago

0.2.0-beta.7

3 years ago

0.2.0-beta.6

3 years ago

0.2.0-beta.5

3 years ago

0.2.0-beta.2

3 years ago

0.2.0-beta.1

3 years ago

0.2.0-beta.0

3 years ago

0.2.0-beta.3

3 years ago

0.2.0-alpha.36

3 years ago

0.2.0-alpha.35

3 years ago

0.2.0-alpha.33

3 years ago

0.2.0-alpha.27

3 years ago

0.2.0-alpha.31

3 years ago

0.2.0-alpha.30

3 years ago

0.2.0-alpha.25

3 years ago

0.2.0-alpha.24

3 years ago

0.2.0-alpha.21

3 years ago

0.2.0-alpha.11

3 years ago