1.0.6 • Published 10 months ago

yonoma_email_marketing v1.0.6

Weekly downloads
-
License
ISC
Repository
github
Last release
10 months ago

Yonoma Node.js Email Marketing SDK

Install

npm install yonoma_email_marketing

Setup

First, you need to get an API key:

import { Yonoma } from "yonoma_email_marketing";

// commonjs
const { Yonoma } = require("yonoma_email_marketing");

const yonoma = new Yonoma("YOUR_API_KEY");

Usage

Send your email:

await yonoma.email.send({
  from_email: 'email@example.com',
  to_email: 'to@example.com',
  subject: 'From Yonoma.io',
  mail_template: 'Everything is working',
});

Groups

Create new group

await yonoma.groups.create({ group_name: "New group" });

Get list of groups

await yonoma.groups.list();

Get one group

await yonoma.groups.retrieve("Group id");

Update group

await yonoma.groups.update("Group id", { group_name: "Updated group name" });

Delete group

await yonoma.groups.delete("Group id");

Tags

Create new tag

await yonoma.tags.create({ tag_name: "New tag" });

Get list of tags

await yonoma.tags.list();

Get one tag

await yonoma.tags.retrieve("Tag id");

Update tag

await yonoma.tags.update("Tag id", { tag_name: "Updated tag name" });

Delete tag

await yonoma.tags.delete("Tag id");

Contacts

Create new contact

await yonoma.contacts.create("Group id", { 
  email: "email@example.com",
  status: "Subscribed" | "Unsubscribed",
  data: {
    firstName: string,
    lastName: string,
    phone: string,
    gender: string,
    address: string,
    city: string,
    state: string,
    country: string,
    zipcode: string,
  }
});

Update contact

await yonoma.contacts.update("Group id", "Contact id", {
  status: "Subscribed" | "Unsubscribed",
});

Add tag to contact

await yonoma.contacts.addTag("Contact id", {
  tag_id: "Tag id",
});

Remove tag from contact

await yonoma.contacts.removeTag("Contact id", {
  tag_id: "Tag id",
});
1.0.6

10 months ago

1.0.5

12 months ago

1.0.4

12 months ago

1.0.3

12 months ago

1.0.2

12 months ago

1.0.1

12 months ago

1.0.0

12 months ago