1.8.2 • Published 11 months ago

@boklisten/bl-email v1.8.2

Weekly downloads
-
License
MIT
Repository
github
Last release
11 months ago

Bl-Email

Install

npm install @boklisten/bl-email

Publish

npm version # Optionally --patch
npm publish

NB: Do not use yarn publish!

Example usage

import the emailHandler

import { EmailHandler } from "@boklisten/bl-email";

create a emailHandler (the emailTemplateConfig will be discussed later)

const emailHandler = new EmailHandler(emailTemplateConfig);

send an email

emailHandler.send({
  userId: "user1",
  toEmail: "wizard@boklisten.com",
  fromEmail: "noreply@email.com",
  subject: "Hi there",
  emailType: "hello",
});

EmailTemplateInput

The emailHandler supports different types of emails tailored for use with boklisten.no apps.

required inputs for all email types
let emailTemplateInput = {
  emailType: "the email type",
  userId: "the id of the user this mail is regarding",
  toEmail: "user@email.com",
  fromEmail: "noreply@email.com",
  subject: "a subject for the email",
};
hello

Used as a welcome message when the customer registers.

required inputs
let emailTemplateInput = {
  emailType: "hello",
};
generic

A generic email that can take display messages specified by the user.

required inputs
let emailTemplateInput = {
  emailType: "generic",
  title: "a title for the message",
  textBlocks: [
    {
      text: "a user created message, can have as many textBlocks as the user wants",
    },
  ],
};
confirm-email

A email that is sent out for the customer to confirm his or her email address

required inputs
let emailTemplateInput = {
  emailType: "confirm-email",
  confirmLink: "a https link for the user to confirm email",
};
password-reset

A email that is sent out if the customer requests a password reset

required inputs
let emailTemplateInput = {
  emailType: "password-reset",
  passwordResetLink: "a https link for the user to reset his or her password",
};
receipt

A email that is sent when a order has been processed, this can for ex. be an order, some deliveries or extends.

required inputs
let emailTemplateInput = {
  emailType: "receipt",
  username: "the name of the user",
  showPrice: true || false,
  showDeadline: true || false,
  numberOfCols: 3,
  items: [
    {
      title: "the title of the item",
      status: "ordered",
      deadline: "the deadline date",
      price: 100,
    },
  ],
  totalPrice: 100,
  order: {
    orderId: "id of order",
  },
};
1.8.2

11 months ago

1.8.1

1 year ago

1.8.0

1 year ago

1.7.5

1 year ago

1.7.4

1 year ago

1.7.2

2 years ago

1.7.1

2 years ago

1.7.0

2 years ago

1.6.0

3 years ago

1.5.10

3 years ago

1.5.12

3 years ago

1.5.11

3 years ago

1.5.3

3 years ago

1.5.2

3 years ago

1.5.1

3 years ago

1.5.9

3 years ago

1.5.8

3 years ago

1.5.6

3 years ago

1.5.0

4 years ago

1.4.31

4 years ago

1.4.30

4 years ago

1.4.32

4 years ago

1.4.29

4 years ago

1.4.28

4 years ago

1.4.27

4 years ago

1.4.26

4 years ago

1.4.25

4 years ago

1.4.24

4 years ago

1.4.23

4 years ago

1.4.22

4 years ago

1.4.21

4 years ago

1.4.20

4 years ago

1.4.19

4 years ago