1.8.0 • Published 1 day ago

@boklisten/bl-email v1.8.0

Weekly downloads
-
License
MIT
Repository
github
Last release
1 day 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.0

1 day ago

1.7.5

1 day ago

1.7.4

21 days ago

1.7.2

1 year ago

1.7.1

1 year ago

1.7.0

1 year ago

1.6.0

2 years ago

1.5.10

2 years ago

1.5.12

2 years ago

1.5.11

2 years ago

1.5.3

2 years ago

1.5.2

2 years ago

1.5.1

2 years ago

1.5.9

2 years ago

1.5.8

2 years ago

1.5.6

2 years ago

1.5.0

2 years ago

1.4.31

2 years ago

1.4.30

2 years ago

1.4.32

2 years ago

1.4.29

2 years ago

1.4.28

3 years ago

1.4.27

3 years ago

1.4.26

3 years ago

1.4.25

3 years ago

1.4.24

3 years ago

1.4.23

3 years ago

1.4.22

3 years ago

1.4.21

3 years ago

1.4.20

3 years ago

1.4.19

3 years ago