2.4.2 • Published 3 years ago

crm-gateway v2.4.2

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

image

CRM Templates

On Site Notifications

Table of contents

Description

The CRM Message Gateway is responsable for the CRUD of SMS and Email templates, also for sending SMS and Emails from the Campaign Gateway.

Technologies

  • TypeScript - version 3.8.3
  • NestJS - version 6.10.14
  • Mongoose - version 6.1.2
  • gRPC- version 1.24.2

Setup

Install the dependencies

$ npm install

Create a .env file in the root of the project and add the following lines

The values of these variables are in here.

# RABBITMQ CONFIG VALUES
RABBITMQ_QUEUE=""
RABBITMQ_EXCHANGE_RESPONSE=""
RABBITMQ_CONNECTION=""

# DB
DB_HOST=""

# Timezone
TZ="utc"

# EMAIL SENDER
UNSUBSCRIBE_URL=""

Run the project

*# development*
$ npm run start

*# watch mode*
$ npm run start:dev

*# production mode*
$ npm run start:prod

Features

  • Full CRUD Operations for managing templates
  • Send direct email

Status

Project is: in progress because we are still developing the gRPC communication layer

Documentation

See documentation on Confluence

gRPC Integration

gRPC Request & Responses

Examples of gRCP request

Email Templates

Create a template

{
  "name": "Welcome Campaign",
  "description": "Welcoming for new registered users.",
  "createdBy": "juan.blanco",
  "companyId": "5dc098efe13604f521bcb6b2",
  "fromEmail": "example@gamanza.com",
  "fromName": "Gamanza Team",
  "replyTo": "no-reply@gamanza.com",
  "bcc": ["____ANY_EMAIL____", "____ANOTHER_EMAIL____"], // Blind Carbon Copy
  "creationMode": "visual", // visual || code
  "tags": ["tag1", "tag2"],
  "templates": [
    {
      "language": "EN",
      "contentHtml": "<h1>Testing1</h1><p>In esse nostrud tempor est pariatur esse.</p>",
      "subject": "Testing 1 (EN)",
      "previewText": "any string",
      "blocks": [
        {
          "type": "SPACE"
        },
        {
          "type": "DIVIDER"
        }
      ]
    },
    {
      "language": "ES",
      "contentHtml": "<h1>Probando1</h1><p>In esse nostrud tempor est pariatur esse.</p>",
      "subject": "Probando 1 (ES)",
      "previewText": "any string",
      "blocks": [
        {
          "type": "HERO_IMAGE",
          "imageUrl": "http://link.com",
          "imageAlt": "string",
          "imageLink": "http://link.com"
        },
        {
          "type": "TITLE",
          "title": "HTML content"
        },
        {
          "type": "TITLE_PARAGRAPH_BUTTON",
          "title": "title content",
          "buttonLabel": "button label",
          "paragraph": "paragraph content"
        },
        {
          "type": "SUBTITLE",
          "subtitle": "subtitle content"
        },
        {
          "type": "PARAGRAPH",
          "paragraph": "HTML content"
        },
        {
          "type": "BUTTON",
          "buttonLabel": "button label",
          "buttonLink": "http://link.com",
          "buttonType": 1
        },
        {
          "type": "IMAGE",
          "imageUrl": "http://link.com",
          "imageAlt": "string",
          "imageLink": "http://link.com"
        },
        {
          "type": "TWO_IMAGES",
          "imageLeftUrl": "http://ho.com",
          "imageLeftAlt": "string",
          "imageLeftLink": "http://hosdf.com",
          "imageRightLink": "http://sdfsf.com",
          "imageRightUrl": "http://ho.com",
          "imageRightAlt": "string"
        },
        {
          "type": "FOUR_IMAGES",
          "imageOneUrl": "http://hod.com",
          "imageOneAlt": "string",
          "imageTwoUrl": "http://dfs.com",
          "imageTwoAlt": "string",
          "imageThreeUrl": "http://hosd.com",
          "imageThreeAlt": "string",
          "imageFourUrl": "http://sdfd.com",
          "imageFourAlt": "string",
          "imageOneLink": "http://dfdfd.com",
          "imageThreeLink": "http://fdfdfd.com",
          "imageTwoLink": "http://sdfdfd.com",
          "imageFourLink": "http://sdfdfd.com"
        },
        {
          "type": "FOUR_IMAGES_BUTTONS",
          "imageOneUrl": "http://sdfdfd.com",
          "imageOneAlt": "string",
          "buttonOneLabel": "string",
          "buttonOneLink": "http://sdfdfd.com",
          "imageTwoUrl": "http://sdfdfd.com",
          "imageTwoAlt": "string",
          "buttonTwoLabel": "string",
          "buttonTwoLink": "http://sdfdfd.com",
          "imageThreeUrl": "http://sdfdfd.com",
          "imageThreeAlt": "string",
          "buttonThreeLabel": "string",
          "buttonThreeLink": "http://sdfdfd.com",
          "imageFourUrl": "http://sdfdfd.com",
          "imageFourAlt": "string",
          "buttonFourLabel": "string",
          "buttonFourLink": "http://sdfdfd.com",
          "imageOneLink": "http://sdfdfd.com",
          "imageTwoLink": "http://sdfdfd.com",
          "imageThreeLink": "http://sdfdfd.com",
          "imageFourLink": "http://sdfdfd.com"
        },
        {
          "type": "TITLE_PARAGRAPH",
          "title": "title content",
          "paragraph": "paragraph content"
        },
        {
          "type": "IMAGE_LEFT_TITLE_PARAGRAPH_BUTTON",
          "title": "title content",
          "paragraph": "paragraph content",
          "buttonLabel": "button label",
          "buttonLink": "http://link.com",
          "imageUrl": "http://link.com",
          "imageAlt": "string",
          "imageLink": "http://link.com"
        },
        {
          "type": "IMAGE_RIGHT_TITLE_PARAGRAPH_BUTTON",
          "title": "title content",
          "paragraph": "paragraph content",
          "buttonLabel": "button label",
          "buttonLink": "http://link.com",
          "imageUrl": "http://link.com",
          "imageAlt": "string",
          "imageLink": "http://link.com"
        },
        {
          "type": "IMAGE_LEFT_TITLE_PARAGRAPH",
          "title": "title content",
          "paragraph": "paragraph content",
          "imageUrl": "http://link.com",
          "imageAlt": "string",
          "imageLink": "http://link.com"
        },
        {
          "type": "IMAGE_RIGHT_TITLE_PARAGRAPH",
          "title": "title content",
          "paragraph": "paragraph content",
          "imageUrl": "http://link.com",
          "imageAlt": "string",
          "imageLink": "http://link.com"
        },
        {
          "type": "IMAGES_TITLE_PARAGRAPH_BUTTON",
          "titleLeft": "string",
          "paragraphLeft": "string",
          "buttonLeftLabel": "string",
          "buttonLeftLink": "http://link.com",
          "imageLeftUrl": "http://link.com",
          "imageLeftAlt": "string",
          "imageLeftLink": "http://link.com",
          "titleRight": "string",
          "paragraphRight": "string",
          "buttonRightLabel": "string",
          "buttonRightLink": "http://link.com",
          "imageRightUrl": "http://link.com",
          "imageRightAlt": "string",
          "imageRightLink": "http://link.com"
        },
        {
          "type": "CUSTOM_NAV_1",
          "nav": "nav content",
          "imageAlt": "image alt",
          "imageLink": "http://link.com",
          "imageUrl": "http://link.com",
          "description": "description sksfd",
          "buttonLink": "http://link.com"
        },
        {
          "type": "CUSTOM_HEADER_1",
          "imageAlt": "image alt",
          "imageLink": "http://link.com"
        },
        {
          "type": "CUSTOM_HEADER_2",
          "imageAlt": "image alt",
          "imageLink": "http://link.com",
          "title": "any other property from custom block"
        },
        {
          "type": "CUSTOM_FOOTER_1",
          "title": "any other property from custom block"
        },
        {
          "type": "CUSTOM_FOOTER_2",
          "title": "any other property from custom block"
        },
        {
          "type": "CUSTOM_SIGN",
          "title": "any other property from custom block"
        },
        {
          "type": "CUSTOM_TERMS",
          "title": "any other property from custom block"
        },
        {
          "type": "CUSTOM_SOCIAL_MEDIA",
          "nav": "tomela"
        },
        {
          "type": "CUSTOM_SMALL_IMAGE_PARAGRAPH",
          "title": "any other property from custom block"
        },
        {
          "type": "CUSTOM_BULLET_PARAGRAPH_BUTTON",
          "title": "any other property from custom block"
        },
        {
          "type": "CUSTOM_CARD_1",
          "title": "any other property from custom block"
        },
        {
          "type": "CUSTOM_CARD_2",
          "title": "any other property from custom block"
        },
        {
          "type": "CUSTOM_CARD_ICON_1",
          "title": "any other property from custom block"
        },
        {
          "type": "CUSTOM_CARD_ICON_2",
          "title": "any other property from custom block"
        },
        {
          "type": "CUSTOM_DIVIDER"
        },
        {
          "type": "CUSTOM_DIVIDER_PARAGRAPH"
        },
        {
          "type": "SPACE"
        },
        {
          "type": "DIVIDER"
        },
        {
          "type": "CENTER_IMAGE",
          "imageUrl": "http://image-source.com",
          "imageAlt": "image alt",
          "imageLink": "http://image-link.com"
        },
        {
          "type": "THREE_IMAGES",
          "imageOneUrl": "http://image-source.com",
          "imageOneAlt": "image alt",
          "imageOneLink": "http://image-link.com",
          "imageTwoUrl": "http://image-source.com",
          "imageTwoAlt": "image alt",
          "imageTwoLink": "http://image-link.com",
          "imageThreeUrl": "http://image-source.com",
          "imageThreeAlt": "image alt",
          "imageThreeLink": "http://image-link.com"
        },
        {
          "type": "THREE_IMAGES_BUTTONS",
          "imageOneUrl": "http://image-source.com",
          "imageOneAlt": "image alt",
          "imageOneLink": "http://image-link.com",
          "imageTwoUrl": "http://image-source.com",
          "imageTwoAlt": "image alt",
          "imageTwoLink": "http://image-link.com",
          "imageThreeUrl": "http://image-source.com",
          "imageThreeAlt": "image alt",
          "imageThreeLink": "http://image-link.com",
          "buttonOneLabel": "button label",
          "buttonOneLink": "http://button-link.com",
          "buttonTwoLabel": "button label",
          "buttonTwoLink": "http://button-link.com",
          "buttonThreeLabel": "button label",
          "buttonThreeLink": "http://button-link.com"
        },
        {
          "type": "CUSTOM_SMALL_IMAGE_PARAGRAPH",
          "title": "any other property from custom block"
        },
        {
          "type": "CUSTOM_MEDIUM_IMAGE_PARAGRAPH",
          "title": "any other property from custom block"
        },
        {
          "type": "CUSTOM_BIG_IMAGE_PARAGRAPH",
          "title": "any other property from custom block"
        },
        {
          "type": "CUSTOM_SMALL_IMAGE_TITLE_PARAGRAPH",
          "title": "any other property from custom block"
        },
        {
          "type": "CUSTOM_MEDIUM_IMAGE_TITLE_PARAGRAPH",
          "title": "any other property from custom block"
        },
        {
          "type": "CUSTOM_BIG_IMAGE_TITLE_PARAGRAPH",
          "title": "any other property from custom block"
        },
        {
          "type": "CUSTOM_TITLE_PARAGRAPH",
          "title": "any other property from custom block"
        },
        {
          "type": "CUSTOM_IMAGE_DIVIDER_TITLE_PARAGRAPH_DIVIDER",
          "title": "any other property from custom block"
        },
        {
          "type": "CUSTOM_PARAGRAPH_BUTTON_PARAGRAPH",
          "title": "any other property from custom block",
          "subtitle": "this is the subtitle",

          "imageUrl": "http://image-source.com",
          "imageAlt": "image alt",
          "imageLink": "http://image-link.com",

          "buttonLabel": "button label",
          "buttonLink": "http://example.com",
          "nav": "this is the nav",

          "description": "this is the description",
          "descriptionTwo": "this is the description",
          "descriptionThree": "this is the description",
          "descriptionFour": "this is the description",
          "descriptionFive": "this is the description",
          "descriptionSix": "this is the description",

          "imageOneUrl": "http://image-source.com",
          "imageOneAlt": "image alt",
          "imageOneLink": "http://image-link.com",

          "imageTwoUrl": "http://image-source.com",
          "imageTwoAlt": "image alt",
          "imageTwoLink": "http://image-link.com",

          "imageThreeUrl": "http://image-source.com",
          "imageThreeAlt": "image alt",
          "imageThreeLink": "http://image-link.com",

          "imageFourUrl": "http://image-source.com",
          "imageFourAlt": "image alt",
          "imageFourLink": "http://image-link.com",

          "imageFiveUrl": "http://image-source.com",
          "imageFiveAlt": "image alt",
          "imageFiveLink": "http://image-link.com",

          "imageSixUrl": "http://image-source.com",
          "imageSixAlt": "image alt",
          "imageSixLink": "http://image-link.com"
        },
        {
          "type": "CUSTOM_BULLETS",
          "title": "any other property from custom block",
          "bullets": [
            {
              "paragraph": "paragraph is required",
              "imageUrl": "http://image-source.com",
              "imageAlt": "image alt",
              "imageLink": "http://image-link.com"
            }
          ]
        }
      ]
    }
  ]
}

Response

{
  "_id": "5f4d439f44e70e10ed4b67f0",
  "name": "Welcome Campaign",
  "description": "Welcoming for new registered users.",
  "createdBy": "juan.celeste",
  "companyId": "5da773139fbffffe3e7417ca",
  "fromEmail": "example@gamanza.com",
  "fromName": "Gamanza Team",
  "replyTo": "no-reply@gamanza.com",
  "creationMode": "visual",
  "tags": ["tag1", "tag2"],
  "templates": [
    {
      "language": "EN",
      "contentHtml": "<h1>Testing1</h1><p>In esse nostrud tempor est pariatur esse.</p>",
      "subject": "Testing 1 (EN)",
      "previewText": "any string",
      "blocks": [
        {
          "type": "SPACE"
        },
        {
          "type": "DIVIDER"
        }
      ]
    },
    {
      "language": "ES",
      "contentHtml": "<h1>Probando1</h1><p>In esse nostrud tempor est pariatur esse.</p>",
      "subject": "Probando 1 (ES)",
      "previewText": "any string",
      "blocks": [
        {
          "type": "HERO_IMAGE",
          "imageUrl": "http://link.com",
          "imageAlt": "string",
          "imageLink": "http://link.com"
        },
        {
          "type": "TITLE",
          "title": "HTML content"
        },
        {
          "type": "TITLE_PARAGRAPH_BUTTON",
          "title": "title content",
          "buttonLabel": "button label",
          "paragraph": "paragraph content"
        },
        {
          "type": "SUBTITLE",
          "subtitle": "subtitle content"
        },
        {
          "type": "PARAGRAPH",
          "paragraph": "HTML content"
        },
        {
          "type": "BUTTON",
          "buttonLabel": "button label",
          "buttonLink": "http://link.com",
          "buttonType": 1
        },
        {
          "type": "IMAGE",
          "imageUrl": "http://link.com",
          "imageAlt": "string",
          "imageLink": "http://link.com"
        },
        {
          "type": "TWO_IMAGES",
          "imageLeftUrl": "http://ho.com",
          "imageLeftAlt": "string",
          "imageLeftLink": "http://hosdf.com",
          "imageRightLink": "http://sdfsf.com",
          "imageRightUrl": "http://ho.com",
          "imageRightAlt": "string"
        },
        {
          "type": "FOUR_IMAGES",
          "imageOneUrl": "http://hod.com",
          "imageOneAlt": "string",
          "imageTwoUrl": "http://dfs.com",
          "imageTwoAlt": "string",
          "imageThreeUrl": "http://hosd.com",
          "imageThreeAlt": "string",
          "imageFourUrl": "http://sdfd.com",
          "imageFourAlt": "string",
          "imageOneLink": "http://dfdfd.com",
          "imageThreeLink": "http://fdfdfd.com",
          "imageTwoLink": "http://sdfdfd.com",
          "imageFourLink": "http://sdfdfd.com"
        },
        {
          "type": "FOUR_IMAGES_BUTTONS",
          "imageOneUrl": "http://sdfdfd.com",
          "imageOneAlt": "string",
          "buttonOneLabel": "string",
          "buttonOneLink": "http://sdfdfd.com",
          "imageTwoUrl": "http://sdfdfd.com",
          "imageTwoAlt": "string",
          "buttonTwoLabel": "string",
          "buttonTwoLink": "http://sdfdfd.com",
          "imageThreeUrl": "http://sdfdfd.com",
          "imageThreeAlt": "string",
          "buttonThreeLabel": "string",
          "buttonThreeLink": "http://sdfdfd.com",
          "imageFourUrl": "http://sdfdfd.com",
          "imageFourAlt": "string",
          "buttonFourLabel": "string",
          "buttonFourLink": "http://sdfdfd.com",
          "imageOneLink": "http://sdfdfd.com",
          "imageTwoLink": "http://sdfdfd.com",
          "imageThreeLink": "http://sdfdfd.com",
          "imageFourLink": "http://sdfdfd.com"
        },
        {
          "type": "TITLE_PARAGRAPH",
          "title": "title content",
          "paragraph": "paragraph content"
        },
        {
          "type": "IMAGE_LEFT_TITLE_PARAGRAPH_BUTTON",
          "title": "title content",
          "paragraph": "paragraph content",
          "buttonLabel": "button label",
          "buttonLink": "http://link.com",
          "imageUrl": "http://link.com",
          "imageAlt": "string",
          "imageLink": "http://link.com"
        },
        {
          "type": "IMAGE_RIGHT_TITLE_PARAGRAPH_BUTTON",
          "title": "title content",
          "paragraph": "paragraph content",
          "buttonLabel": "button label",
          "buttonLink": "http://link.com",
          "imageUrl": "http://link.com",
          "imageAlt": "string",
          "imageLink": "http://link.com"
        },
        {
          "type": "IMAGE_LEFT_TITLE_PARAGRAPH",
          "title": "title content",
          "paragraph": "paragraph content",
          "imageUrl": "http://link.com",
          "imageAlt": "string",
          "imageLink": "http://link.com"
        },
        {
          "type": "IMAGE_RIGHT_TITLE_PARAGRAPH",
          "title": "title content",
          "paragraph": "paragraph content",
          "imageUrl": "http://link.com",
          "imageAlt": "string",
          "imageLink": "http://link.com"
        },
        {
          "type": "IMAGES_TITLE_PARAGRAPH_BUTTON",
          "titleLeft": "string",
          "paragraphLeft": "string",
          "buttonLeftLabel": "string",
          "buttonLeftLink": "http://link.com",
          "imageLeftUrl": "http://link.com",
          "imageLeftAlt": "string",
          "imageLeftLink": "http://link.com",
          "titleRight": "string",
          "paragraphRight": "string",
          "buttonRightLabel": "string",
          "buttonRightLink": "http://link.com",
          "imageRightUrl": "http://link.com",
          "imageRightAlt": "string",
          "imageRightLink": "http://link.com"
        },
        {
          "type": "CUSTOM_NAV_1",
          "nav": "nav content",
          "imageAlt": "image alt",
          "imageLink": "http://link.com",
          "imageUrl": "http://link.com",
          "description": "description sksfd",
          "buttonLink": "http://link.com"
        },
        {
          "type": "CUSTOM_HEADER_1",
          "imageAlt": "image alt",
          "imageLink": "http://link.com"
        },
        {
          "type": "CUSTOM_HEADER_2",
          "imageAlt": "image alt",
          "imageLink": "http://link.com",
          "title": "any other property from custom block"
        },
        {
          "type": "CUSTOM_FOOTER_1",
          "title": "any other property from custom block"
        },
        {
          "type": "CUSTOM_FOOTER_2",
          "title": "any other property from custom block"
        },
        {
          "type": "CUSTOM_SIGN",
          "title": "any other property from custom block"
        },
        {
          "type": "CUSTOM_TERMS",
          "title": "any other property from custom block"
        },
        {
          "type": "CUSTOM_SOCIAL_MEDIA",
          "nav": "tomela"
        },
        {
          "type": "CUSTOM_SMALL_IMAGE_PARAGRAPH",
          "title": "any other property from custom block"
        },
        {
          "type": "CUSTOM_BULLET_PARAGRAPH_BUTTON",
          "title": "any other property from custom block"
        },
        {
          "type": "CUSTOM_CARD_1",
          "title": "any other property from custom block"
        },
        {
          "type": "CUSTOM_CARD_2",
          "title": "any other property from custom block"
        },
        {
          "type": "CUSTOM_CARD_ICON_1",
          "title": "any other property from custom block"
        },
        {
          "type": "CUSTOM_CARD_ICON_2",
          "title": "any other property from custom block"
        },
        {
          "type": "CUSTOM_DIVIDER"
        },
        {
          "type": "CUSTOM_DIVIDER_PARAGRAPH"
        },
        {
          "type": "SPACE"
        },
        {
          "type": "DIVIDER"
        },
        {
          "type": "CENTER_IMAGE",
          "imageUrl": "http://image-source.com",
          "imageAlt": "image alt",
          "imageLink": "http://image-link.com"
        },
        {
          "type": "THREE_IMAGES",
          "imageOneUrl": "http://image-source.com",
          "imageOneAlt": "image alt",
          "imageOneLink": "http://image-link.com",
          "imageTwoUrl": "http://image-source.com",
          "imageTwoAlt": "image alt",
          "imageTwoLink": "http://image-link.com",
          "imageThreeUrl": "http://image-source.com",
          "imageThreeAlt": "image alt",
          "imageThreeLink": "http://image-link.com"
        },
        {
          "type": "THREE_IMAGES_BUTTONS",
          "imageOneUrl": "http://image-source.com",
          "imageOneAlt": "image alt",
          "imageOneLink": "http://image-link.com",
          "imageTwoUrl": "http://image-source.com",
          "imageTwoAlt": "image alt",
          "imageTwoLink": "http://image-link.com",
          "imageThreeUrl": "http://image-source.com",
          "imageThreeAlt": "image alt",
          "imageThreeLink": "http://image-link.com",
          "buttonOneLabel": "button label",
          "buttonOneLink": "http://button-link.com",
          "buttonTwoLabel": "button label",
          "buttonTwoLink": "http://button-link.com",
          "buttonThreeLabel": "button label",
          "buttonThreeLink": "http://button-link.com"
        },
        {
          "type": "CUSTOM_SMALL_IMAGE_PARAGRAPH",
          "title": "any other property from custom block"
        },
        {
          "type": "CUSTOM_MEDIUM_IMAGE_PARAGRAPH",
          "title": "any other property from custom block"
        },
        {
          "type": "CUSTOM_BIG_IMAGE_PARAGRAPH",
          "title": "any other property from custom block"
        },
        {
          "type": "CUSTOM_SMALL_IMAGE_TITLE_PARAGRAPH",
          "title": "any other property from custom block"
        },
        {
          "type": "CUSTOM_MEDIUM_IMAGE_TITLE_PARAGRAPH",
          "title": "any other property from custom block"
        },
        {
          "type": "CUSTOM_BIG_IMAGE_TITLE_PARAGRAPH",
          "title": "any other property from custom block"
        },
        {
          "type": "CUSTOM_TITLE_PARAGRAPH",
          "title": "any other property from custom block"
        },
        {
          "type": "CUSTOM_IMAGE_DIVIDER_TITLE_PARAGRAPH_DIVIDER",
          "title": "any other property from custom block"
        },
        {
          "type": "CUSTOM_PARAGRAPH_BUTTON_PARAGRAPH",
          "title": "any other property from custom block",
          "subtitle": "this is the subtitle",

          "imageUrl": "http://image-source.com",
          "imageAlt": "image alt",
          "imageLink": "http://image-link.com",

          "buttonLabel": "button label",
          "buttonLink": "http://example.com",
          "nav": "this is the nav",

          "description": "this is the description",
          "descriptionTwo": "this is the description",
          "descriptionThree": "this is the description",
          "descriptionFour": "this is the description",
          "descriptionFive": "this is the description",
          "descriptionSix": "this is the description",

          "imageOneUrl": "http://image-source.com",
          "imageOneAlt": "image alt",
          "imageOneLink": "http://image-link.com",

          "imageTwoUrl": "http://image-source.com",
          "imageTwoAlt": "image alt",
          "imageTwoLink": "http://image-link.com",

          "imageThreeUrl": "http://image-source.com",
          "imageThreeAlt": "image alt",
          "imageThreeLink": "http://image-link.com",

          "imageFourUrl": "http://image-source.com",
          "imageFourAlt": "image alt",
          "imageFourLink": "http://image-link.com",

          "imageFiveUrl": "http://image-source.com",
          "imageFiveAlt": "image alt",
          "imageFiveLink": "http://image-link.com",

          "imageSixUrl": "http://image-source.com",
          "imageSixAlt": "image alt",
          "imageSixLink": "http://image-link.com"
        },
        {
          "type": "CUSTOM_BULLETS",
          "title": "any other property from custom block",
          "bullets": [
            {
              "paragraph": "paragraph is required",
              "imageUrl": "http://image-source.com",
              "imageAlt": "image alt",
              "imageLink": "http://image-link.com"
            }
          ]
        }
      ]
    }
  ],
  "isDeleted": false,
  "active": true,
  "createdAt": "Mon Aug 31 2020 18:38:23 GMT+0000 (GMT)",
  "updatedAt": "Mon Aug 31 2020 18:38:23 GMT+0000 (GMT)"
}

Get all templates

Only isArchive is required.

{
  "isArchive": false
}

Response

{
  "docs": [
    {
      "active": true,
      "isDeleted": false,
      "_id": "5e3d8011a8989a3b7901a396",
      "name": "Welcome Campaign",
      "description": "Welcoming for new registered users.",
      "createdBy": "juan.blanco",
      "companyId": "5dc098efe13604f521bcb6b2",
      "fromEmail": "example@gamanza.com",
      "fromName": "Gamanza Team",
      "replyTo": "no-reply@gamanza.com",
      "bcc": ["example@test.com", "example2@test.com"],
      "creationMode": "code",
      "templates": [
        {
          "_id": "5e3d8011a8989a3b7901a397",
          "subject": "Bienvenido!",
          "language": "ES",
          "contentHtml": "<h4>Hola {{FirstName}} {{LastName}}</h4> <p>Que gusto nos da tenerte aqui!</p>"
        },
        {
          "_id": "5e3d8011a8989a3b7901a398",
          "subject": "Welcome!",
          "language": "EN",
          "contentHtml": "<h4>Hello {{FirstName}} {{LastName}}</h4> <p>It is a pleasure having you here. </p>"
        }
      ],
      "createdAt": "2020-02-07T15:19:45.035Z",
      "updatedAt": "2020-02-07T15:19:45.035Z",
      "__v": 0
    }
  ],
  "total": 1,
  "limit": 25,
  "page": 1,
  "pages": 1
}

Get template by Id

{
  "id": "5e3d8011a8989a3b7901a396"
}

Response

{
  "active": true,
  "isDeleted": false,
  "_id": "5e3d8011a8989a3b7901a396",
  "name": "Welcome Campaign",
  "description": "Welcoming for new registered users.",
  "createdBy": "juan.blanco",
  "companyId": "5dc098efe13604f521bcb6b2",
  "fromEmail": "example@gamanza.com",
  "fromName": "Gamanza Team",
  "replyTo": "no-reply@gamanza.com",
  "bcc": ["example@test.com", "example2@test.com"], // Blind Carbon Copy
  "creationMode": "code",
  "templates": [
    {
      "_id": "5e3d8011a8989a3b7901a397",
      "subject": "Bienvenido!",
      "language": "ES",
      "contentHtml": "<h4>Hola {{FirstName}} {{LastName}}</h4> <p>Que gusto nos da tenerte aqui!</p>"
    },
    {
      "_id": "5e3d8011a8989a3b7901a398",
      "subject": "Welcome!",
      "language": "EN",
      "contentHtml": "<h4>Hello {{FirstName}} {{LastName}}</h4> <p>It is a pleasure having you here. </p>"
    }
  ],
  "createdAt": "2020-02-07T15:19:45.035Z",
  "updatedAt": "2020-02-07T15:19:45.035Z",
  "__v": 0
}

Get Templates name and ID by companyID

{
  "companyId": "5df958506e4f7e5cac6f847f"
}

Response

{
  "docs": [
    {
      "_id": "5e56f0b0ded5283d1c70a8c8",
      "name": "Welcome Campaign3"
    },
    {
      "_id": "5e56f162ded5283d1c70a8ce",
      "name": "Welcome Campaign"
    },
    {
      "_id": "5e56f16eded5283d1c70a8d1",
      "name": "Welcome Campaign2"
    }
  ]
}

Get template languages by Id

{
  "id": "5dc098efe13604f521bcb6b2"
}

Response

{
  "languages": ["ES", "EN"]
}

Get templates by filter

Only isArchive is required. You can choose either non archive or archive templates just passing isArchive value lenguaje, createdBy and company are arrays of values searchParam (name and description)

{
  "isArchive": false,
  "limit": 10,
  "page": 1,
  "searchParam": "wel",
  "createdBy": ["juan.blanco"],
  "companyId": ["5dc098efe13604f521bcb6b2"],
  "subject": "test",
  "language": ["ES"]
}

Response

{
  "docs": [
    {
      "active": true,
      "isDeleted": false,
      "_id": "5e3d8011a8989a3b7901a396",
      "name": "Welcome Campaign",
      "description": "Welcoming for new registered users.",
      "createdBy": "juan.blanco",
      "companyId": "5dc098efe13604f521bcb6b2",
      "fromEmail": "example@gamanza.com",
      "fromName": "Gamanza Team",
      "replyTo": "no-reply@gamanza.com",
      "bcc": ["example@test.com", "example2@test.com"],
      "creationMode": "code",
      "templates": [
        {
          "_id": "5e3d8011a8989a3b7901a397",
          "subject": "Bienvenido!",
          "language": "ES",
          "contentHtml": "<h4>Hola {{FirstName}} {{LastName}}</h4> <p>Que gusto nos da tenerte aqui!</p>"
        },
        {
          "_id": "5e3d8011a8989a3b7901a398",
          "subject": "Welcome!",
          "language": "EN",
          "contentHtml": "<h4>Hello {{FirstName}} {{LastName}}</h4> <p>It is a pleasure having you here. </p>"
        }
      ],
      "createdAt": "2020-02-07T15:19:45.035Z",
      "updatedAt": "2020-02-07T15:19:45.035Z",
      "__v": 0
    }
  ],
  "total": 1,
  "limit": 10,
  "page": 1,
  "pages": 1
}

Get templates with page param

{
  "page": 2
}

Get templates with page and limit params

{
  "page": 1,
  "limit": 50
}

Response

{
  "docs": [
    {
      "active": true,
      "isDeleted": false,
      "_id": "5e3d8011a8989a3b7901a396",
      "name": "Welcome Campaign",
      "description": "Welcoming for new registered users.",
      "createdBy": "juan.blanco",
      "companyId": "5dc098efe13604f521bcb6b2",
      "fromEmail": "example@gamanza.com",
      "fromName": "Gamanza Team",
      "replyTo": "no-reply@gamanza.com",
      "bcc": ["example@test.com", "example2@test.com"],
      "creationMode": "code",
      "templates": [
        {
          "_id": "5e3d8011a8989a3b7901a397",
          "subject": "Bienvenido!",
          "language": "ES",
          "contentHtml": "<h4>Hola {{FirstName}} {{LastName}}</h4> <p>Que gusto nos da tenerte aqui!</p>"
        },
        {
          "_id": "5e3d8011a8989a3b7901a398",
          "subject": "Welcome!",
          "language": "EN",
          "contentHtml": "<h4>Hello {{FirstName}} {{LastName}}</h4> <p>It is a pleasure having you here. </p>"
        }
      ],
      "createdAt": "2020-02-07T15:19:45.035Z",
      "updatedAt": "2020-02-07T15:19:45.035Z",
      "__v": 0
    }
  ],
  "total": 1,
  "limit": 50,
  "page": 1,
  "pages": 1
}

Update a template

You can update any property of the template, only id is required.

{
  "id": "5dc0944ffce6a5da9c67e845",
  "name": "New Promo Code"
}

Response

{
  "templates": [
    {
      "language": "ES",
      "contentHtml": "<h4>Hola {{FirstName}} {{LastName}}</h4> <p>Que gusto nos da tenerte aqui!</p>",
      "subject": "Bienvenido!"
    },
    {
      "language": "EN",
      "contentHtml": "<h4>Hello {{FirstName}} {{LastName}}</h4> <p>It is a pleasure having you here. </p>",
      "subject": "Welcome!"
    }
  ],
  "_id": "5e94d22f0904b549d52b09de",
  "name": "New Promo Code",
  "description": "Welcoming for new registered users.",
  "createdBy": "juan.blanco",
  "companyId": "5dc098efe13604f521bcb6b2",
  "fromEmail": "example@gamanza.com",
  "fromName": "Gamanza Team",
  "replyTo": "no-reply@gamanza.com",
  "bcc": ["example@test.com", "example2@test.com"],
  "creationMode": "code",
  "isDeleted": false,
  "active": true,
  "createdAt": "Mon Apr 13 2020 20:57:19 GMT+0000 (GMT)",
  "updatedAt": "Tue Apr 14 2020 20:21:54 GMT+0000 (GMT)",
  "__V": 0
}

Duplicate a template

You can duplicate an existing template.

All the following properties are required.

{
  "id": "5e04ee0d54cb767040a14c04",
  "createdBy": "juan.blanco"
}

Response

{
  "active": true,
  "name": "Welcome Campaign!_1",
  "description": "Welcoming for new registered users.",
  "fromEmail": "example@gamanza.com",
  "fromName": "Gamanza Team",
  "replyTo": "no-reply@gamanza.com",
  "bcc": ["example@test.com", "example2@test.com"],
  "creationMode": "code",
  "templates": [
    {
      "_id": "5e171598b8f0051d8dff5b28",
      "subject": "Bienvenido!",
      "language": "ES",
      "contentHtml": "<h4>Hola {{FirstName}} {{LastName}}</h4> <p>Que gusto nos da tenerte aqui!</p>"
    },
    {
      "_id": "5e171598b8f0051d8dff5b27",
      "subject": "Welcome!",
      "language": "EN",
      "contentHtml": "<h4>Hello {{FirstName}} {{LastName}}</h4> <p>It is a pleasure having you here. </p>"
    }
  ],
  "createdAt": "2020-01-09T14:39:59.097Z",
  "updatedAt": "2020-01-09T14:39:59.097Z",
  "__v": 0
}

Change status

{
  "id": "5e3d8011a8989a3b7901a396",
  "active": false
}

Response

{
  "active": false,
  "isDeleted": false,
  "_id": "5e3d8011a8989a3b7901a396",
  "name": "New Promo Code 22",
  "description": "Welcoming for new registered users.",
  "createdBy": "juan.blanco",
  "companyId": "5dc098efe13604f521bcb6b2",
  "fromEmail": "example@gamanza.com",
  "fromName": "Gamanza Team",
  "replyTo": "no-reply@gamanza.com",
  "bcc": ["example@test.com", "example2@test.com"],
  "creationMode": "code",
  "templates": [
    {
      "_id": "5e3d8011a8989a3b7901a397",
      "subject": "Bienvenido!",
      "language": "ES",
      "contentHtml": "<h4>Hola {{FirstName}} {{LastName}}</h4> <p>Que gusto nos da tenerte aqui!</p>"
    },
    {
      "_id": "5e3d8011a8989a3b7901a398",
      "subject": "Welcome!",
      "language": "EN",
      "contentHtml": "<h4>Hello {{FirstName}} {{LastName}}</h4> <p>It is a pleasure having you here. </p>"
    }
  ],
  "createdAt": "2020-02-07T15:19:45.035Z",
  "updatedAt": "2020-02-07T16:11:38.756Z",
  "__v": 0
}

ARCHIVE a template by ID

You can archive a template using the property isDeleted

id (Template ID)

{
  "id": "5e3d8011a8989a3b7901a396",
  "isDeleted": true
}

Response

{
  "active": false,
  "isDeleted": true,
  "_id": "5e3d8011a8989a3b7901a396",
  "name": "New Promo Code 22",
  "description": "Welcoming for new registered users.",
  "createdBy": "juan.blanco",
  "companyId": "5dc098efe13604f521bcb6b2",
  "fromEmail": "example@gamanza.com",
  "fromName": "Gamanza Team",
  "replyTo": "no-reply@gamanza.com",
  "bcc": ["example@test.com", "example2@test.com"],
  "creationMode": "code",
  "templates": [
    {
      "_id": "5e3d8011a8989a3b7901a397",
      "subject": "Bienvenido!",
      "language": "ES",
      "contentHtml": "<h4>Hola {{FirstName}} {{LastName}}</h4> <p>Que gusto nos da tenerte aqui!</p>"
    },
    {
      "_id": "5e3d8011a8989a3b7901a398",
      "subject": "Welcome!",
      "language": "EN",
      "contentHtml": "<h4>Hello {{FirstName}} {{LastName}}</h4> <p>It is a pleasure having you here. </p>"
    }
  ],
  "createdAt": "2020-02-07T15:19:45.035Z",
  "updatedAt": "2020-02-07T16:17:24.282Z",
  "__v": 0
}

UNARCHIVE a template by ID

You can unarchive a template using the property isDeleted

id (Template ID)

{
  "id": "5e3d8011a8989a3b7901a396",
  "isDeleted": false
}

Response

{
  "active": false,
  "isDeleted": false,
  "_id": "5e3d8011a8989a3b7901a396",
  "name": "New Promo Code 22",
  "description": "Welcoming for new registered users.",
  "createdBy": "juan.blanco",
  "companyId": "5dc098efe13604f521bcb6b2",
  "fromEmail": "example@gamanza.com",
  "fromName": "Gamanza Team",
  "replyTo": "no-reply@gamanza.com",
  "bcc": ["example@test.com", "example2@test.com"],
  "creationMode": "code",
  "templates": [
    {
      "_id": "5e3d8011a8989a3b7901a397",
      "subject": "Bienvenido!",
      "language": "ES",
      "contentHtml": "<h4>Hola {{FirstName}} {{LastName}}</h4> <p>Que gusto nos da tenerte aqui!</p>"
    },
    {
      "_id": "5e3d8011a8989a3b7901a398",
      "subject": "Welcome!",
      "language": "EN",
      "contentHtml": "<h4>Hello {{FirstName}} {{LastName}}</h4> <p>It is a pleasure having you here. </p>"
    }
  ],
  "createdAt": "2020-02-07T15:19:45.035Z",
  "updatedAt": "2020-02-07T16:19:24.581Z",
  "__v": 0
}

Sender

Send Campaigns

To send a campaign the following data is necessary. All properties are optional, a property is only required when a template placeholder requires any property for replacing.

{
  "templateId": "5e31f63825f6f12bb00a6b15",
  "campaignId": "5e31f7291cb2cf3111dcbcc9",
  "type": 1, // CAMPAIGN = 1, TRIGGER = 2,
  "channel": 1, // EMAIL = 1, SMS = 2
  "provider": {
    "apiKey": "THE_PROVIDER_API_KEY",
    "defaultLanguage": "EN"
  },
  "users": [
    {
      "UserName": "angel",
      "FirstName": "Angel",
      "LastName": "Rodriguez",
      "Country": "CR",
      "City": "San Pablo",
      "PlayerLanguage": "ES",
      "AllowsEmails": true,
      "AllowsSMS": false,
      "EmailAddress": "___YOUR__EMAIL___",
      "MobileNumber": "88888888",
      "Currency": "USD",
      "DateBirth": "2019-11-06T22:12:08.794Z",
      "Age": 29,
      "Gender": "m",
      "AccountStatus": "active",
      "RegistrationDate": "2019-11-06T22:12:08.794Z",
      "LastLogin": "2019-11-06T22:12:08.794Z",
      "FirstDeposit": "2019-11-06T22:12:08.794Z",
      "PostalCode": 9485,
      "Nationality": "USA",
      "PlayerId": "5e821ba071f32029881e4a55"
    }
  ],
  "EventContent": ""
}

Send a Test Email Directly

Email Types

export enum SendDirectEmailType {
  RESET_PASSWORD = 0,
  WELCOME_USER = 1,
  TEST_CAMPAIGN = 2,
  TEST_PROVIDER = 3,
}

To send direct email is necessary the following data.

All properties are optional. Placeholders like URL and Username are required when the email type is 0.Reset Password or 1.Welcome User type SendDirectEmailType Enum

{
  "type": 1,
  "companyId": "5e8c5a2e23f79a78edf7e8ba",
  "provider": {
    "apiKey": "THE_PROVIDER_API_KEY",
    "defaultLanguage": "EN"
  },
  "from": "admin@gamanza.com",
  "fromName": "admin",
  "to": "email@gamanza.com",
  "replyTo": "no-reply@gamanza.com",
  "replyToName": "Not Reply",
  "subject": "Dear {{FirstName}} {{LastName}}",
  "HTMLBody": "<h4>Test {{FirstName}} {{LastName}} 😏</h4>",
  "placeholders": {
    "URL": "___SOME_URL___",
    "UserName": "juan.blanco",
    "FirstName": "Juan",
    "LastName": "Blanco",
    "Country": "US",
    "City": "Tres Rios",
    "PlayerLanguage": "EN",
    "AllowsEmails": true,
    "AllowsSMS": false,
    "EmailAddress": "___YOUR__EMAIL___",
    "MobileNumber": "",
    "Currency": "USD",
    "DateBirth": "2019-11-06T22:12:08.794Z",
    "Age": 30,
    "Gender": "m",
    "AccountStatus": "",
    "RegistrationDate": "2019-11-06T22:12:08.794Z",
    "LastLogin": "2019-11-06T22:12:08.794Z",
    "FirstDeposit": "2019-11-06T22:12:08.794Z",
    "PostalCode": 9485,
    "Nationality": "USA",
    "PlayerId": "5e821ba071f32029881e4a55",
    "EventContent": ""
  }
}

Sendgrid example

{
  "type": 0,
  "companyId": "5e3053866e65eb23f049598a",
  "provider": {
    "apiKey": "SENDGRID_API_KEY",
    "defaultLanguage": "EU"
  },
  "from": "admin@gamanza.com",
  "fromName": "admin",
  "to": "carlos.vanegas@gamanza.com",
  "replyTo": "no-reply@gamanza.com",
  "replyToName": "Not Reply",
  "subject": "Reset Password",
  "HTMLBody": "<h4>Hello {{FirstName}} {{LastName}}, to reset your password please click on the following link: {{URL}}</h4>",
  "placeholders": {
    "URL": "https://gamanza.com/reset-password?email={{EmailAdress}}",
    "EmailAddress": "___YOUR__EMAIL___",
    "FirstName": "Angel",
    "LastName": "Rodriguez",
    "UserName": "angel.rodriguez"
  }
}

Send Invite Friends Email Campaign

export enum InviteFriendsType {
  TOKEN = 1,
  CODE,
  USERNAME,
}
export enum InviteFriendsMethod {
  EMAIL = 1,
  SMS,
}
{
  "campaignId": "5eced387c0bcb0f211219b48",
  "provider": {
    "apiKey": "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",
    "defaultLanguage": "EN"
  },
  "channel": 1, // 1.EMAIL, 2.SMS
  "type": 2, // 1.CAMPAIGN, 2.TRIGGER
  "templateId": "5f10d6ac2a4c170f4a78b00b",
  "trigger": 23, // 23. REFERS A FRIEND (INVIRED), 27. REFERS A FRIEND (PLAYER)
  "users": [
    {
      "Type": 1, // InviteFriendsType Enum
      "TypeValue": "48af20fa61cc30474a2b83581e8a9694321fce763e1abb78d9d8148445210319b4db7f8d4c9d7f79a8b0a12fa91d7b935730a7d5ebcb965999fda8b032182b8b",
      "Method": 1,
      "MethodValue": "angel.rodriguez@gamanza.com", // InviteFriendsMethod Enum
      "Name": "Angel Rodriguez",
      "PlayerLanguage": "EN",
      "Gender": "m",
      "Date": "2020-05-05T13:40:28.936Z",
      "PlayerId": "f37e7dfe-5de0-4494-886c-437d496e4218",
      "FirstName": "Jose",
      "LastName": "Rodriguez",
      "UserName": "jose.rodriguez",
      "EmailAddress": "angeldcora@gmail.com",
      "EventContent": "mega string",
      "ReferredFirstName": "Angel",
      "ReferredLastName": "Rodriguez",
      "ReferredLanguage": "EN",
      "ReferredGender": "f",
      "ReferredEmail": "angel.rodriguez@gamanza.com",
      "ReferredMobile": ""
    }
  ]
}

Sender SMS

Send Custom Message

To send a personalized message, an array with the phone number and the text to send is required.

{
  "mobileNumbers": ["50698073088", "50660470099"],
  "text": "Hello"
}

Response

{
  "success": true
}

Send Test Template Message

{
  "mobileNumbers": "50684073281,50684073582",
  "templateContents": [
    {
      "language": "EN",
      "content": "Hello EN",
      "title": "title 1"
    },
    {
      "language": "DE",
      "content": "Hi DE",
      "title": "title 2"
    }
  ]
}

Response

{
  "success": true
}

Send Campaign Message

{
  "users": [
    {
      "UserName": "angel",
      "FirstName": "Angel",
      "LastName": "Rodriguez",
      "Country": "CR",
      "City": "San Pablo",
      "PlayerLanguage": "ES",
      "AllowsEmails": true,
      "AllowsSMS": false,
      "EmailAddress": "asdasd@gmail.com",
      "MobileNumber": "50670470009",
      "Currency": "USD",
      "DateBirth": "2019-11-06T22:12:08.794Z",
      "Age": 29,
      "Gender": "m",
      "AccountStatus": "active",
      "RegistrationDate": "2019-11-06T22:12:08.794Z",
      "LastLogin": "2019-11-06T22:12:08.794Z",
      "FirstDeposit": "2019-11-06T22:12:08.794Z",
      "PostalCode": 9485,
      "Nationality": "USA",
      "PlayerId": "5e821ba071f32029881e4a55"
    }
  ],
  "templateId": "5ed6c10b15f355115334ff5b",
  "campaignId": "5eecfa7f7da9be62226a214a",
  "defaultLanguage": "EN"
}

Response

{
  "success": true
}

Template SMS

Create a template sms

{
  "name": "Wellcome",
  "description": "Wellcome new player",
  "createdBy": "Angel",
  "companyId": "5ef27a1487aaa93d828686b8",
  "templateContents": [
    {
      "language": "EN",
      "content": "Wellcome new player",
      "title": "Gamanza"
    }
  ],
  "tags": ["Hello"]
}

Response

{
  "templateContents": [
    {
      "language": "EN",
      "content": "Hello",
      "title": "Hello"
    }
  ],
  "tags": ["Hello"],
  "_id": "5f1b48fdb5c7ce42db1c751a",
  "name": "Hello",
  "description": "Hello",
  "createdBy": "Hello",
  "companyId": "5ed925790dffa90aee3aef6a",
  "isDeleted": false,
  "active": true,
  "createdAt": "Fri Jul 24 2020 20:47:57 GMT+0000 (GMT)",
  "updatedAt": "Fri Jul 24 2020 20:47:57 GMT+0000 (GMT)",
  "__V": 0
}

Get a template sms

{
  "id": "5ef27a1487aaa93d828686b8"
}

Response

{
  "templateContents": [
    {
      "language": "EN",
      "content": "Wellcome new player",
      "title": "Gamanza"
    }
  ],
  "tags": ["Hello"],
  "_id": "5ed925790dffa90aee3aef6a",
  "name": "Wellcome",
  "description": "Wellcome new player",
  "createdBy": "user1",
  "companyId": "507f191e810c19729de860ea",
  "isDeleted": true,
  "active": true,
  "createdAt": "Thu Jun 04 2020 16:46:49 GMT+0000 (GMT)",
  "updatedAt": "Fri Jul 24 2020 17:41:00 GMT+0000 (GMT)",
  "__V": 0
}

Get templates name sms

{
  "companyId": "507f191e810c19729de861ea"
}

Response

{
  "templates": [
    {
      "id": "",
      "name": "Hello1"
    },
    {
      "id": "",
      "name": "Hello 1"
    }
  ]
}

Get all template sms

{
  "language": ["EN"],
  "tags": ["Hello"],
  "createdBy": ["user1"],
  "companyId": ["507f191e810c19729de860ea"],
  "limit": 10,
  "page": 1,
  "isArchive": false
}

Response

{
  "docs": [
    {
      "templateContents": [
        {
          "language": "EN",
          "content": "{{TitleFirstName}} {{FirstName}}, Welcome to Pasino",
          "title": ""
        },
        {
          "language": "DE",
          "content": "{{FirstName}}, Willkommen zu Pasino",
          "title": ""
        },
        {
          "language": "FR",
          "content": "{{TitleFirstName}} {{FirstName}}, Bienvenue à Pasino",
          "title": ""
        },
        {
          "language": "IT",
          "content": "{{FirstName}}, Benvenuto a Pasino",
          "title": ""
        }
      ],
      "tags": ["Hello"],
      "_id": "5ed6c10b15f355115334ff5b",
      "name": "sms1",
      "description": "description2",
      "createdBy": "user1",
      "companyId": "507f191e810c19729de860ea",
      "isDeleted": false,
      "active": false,
      "createdAt": "Tue Jun 02 2020 21:13:47 GMT+0000 (GMT)",
      "updatedAt": "Mon Jul 13 2020 22:35:48 GMT+0000 (GMT)",
      "__V": 0
    }
  ],
  "total": 1,
  "limit": 10,
  "page": 1,
  "pages": 1
}

Update a template sms

{
  "id": "5ef27a1487aaa93d828686b8",
  "name": "Wellcome",
  "description": "Wellcome new player",
  "templateContents": [
    {
      "language": "EN",
      "content": "Wellcome new player",
      "title": "Gamanza"
    }
  ],
  "isDeleted": true,
  "tags": ["Hello"]
}

Response

{
  "templateContents": [
    {
      "language": "EN",
      "content": "Wellcome new player",
      "title": "Gamanza"
    }
  ],
  "tags": ["Hello"],
  "_id": "5ed925790dffa90aee3aef6a",
  "name": "Wellcome",
  "description": "Wellcome new player",
  "createdBy": "user1",
  "companyId": "507f191e810c19729de860ea",
  "isDeleted": true,
  "active": true,
  "createdAt": "Thu Jun 04 2020 16:46:49 GMT+0000 (GMT)",
  "updatedAt": "Fri Jul 24 2020 17:41:00 GMT+0000 (GMT)",
  "__V": 0
}

Duplicate a template sms

{
  "id": "5f3ef786c097231fe6708b16",
  "createdBy": "Juan"
}

Response

{
  "templateContents": [
    {
      "language": "ES",
      "content": "Hello",
      "title": "Hello"
    }
  ],
  "tags": ["Hello"],
  "_id": "5f4576d4ea7957341251e061",
  "name": "Hello 5_copy_copy_copy",
  "description": "Hello",
  "createdBy": "Juan",
  "companyId": "5ed925790dffa90aee3aef6b",
  "isDeleted": false,
  "active": true,
  "createdAt": "Tue Aug 25 2020 20:38:44 GMT+0000 (GMT)",
  "updatedAt": "Tue Aug 25 2020 20:38:44 GMT+0000 (GMT)",
  "__V": 0
}

Rules Engine Sender

For sending rules engine using the email sender or the sms sender you need only to change the channel

Send using email sender

{
  "provider": {
    "apiKey": "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",
    "defaultLanguage": "ES"
  },
  "templateId": "5f7f43978f058d13fcb115c5",
  "channel": 1, // for email sender
  "contacts": ["___SOME@EMAIL.COM___", "___SOME@EMAIL.COM___"],
  "placeholders": {
    "UserName": "Hello",
    "FirstName": "Hello",
    "LastName": "Hello",
    "Country": "CR",
    "City": "Hello",
    "PlayerLanguage": "ES",
    "AllowsEmails": true,
    "AllowsSMS": true,
    "EmailAddress": "test@test.com",
    "MobileNumber": "Hello",
    "Currency": "USD",
    "DateBirth": "2020-07-21T16:06:29.383+00:00",
    "Age": 10,
    "Gender": "f",
    "AccountStatus": "Hello",
    "RegistrationDate": "2020-07-21T16:06:29.383+00:00",
    "LastLogin": "2020-07-21T16:06:29.383+00:00",
    "FirstDeposit": "2020-07-21T16:06:29.383+00:00",
    "PostalCode": 10,
    "Nationality": "Hello",
    "PlayerId": "e961d6d7-c049-4ecc-9ab9-16f313bec170",
    "Amount": 10,
    "TransactionType": "Hello",
    "Date": "2020-07-21T16:06:29.383+00:00",
    "TransactionStatus": 10,
    "PaymentProvider": "Hello",
    "PaymentMethod": "Hello",
    "DepositId": "854cebe0-263b-48ab-978e-babe56be2908",
    "DepositCount": 10,
    "BonusName": "Hello",
    "BonusType": "Hello",
    "BonusId": 10,
    "FreeSpinAmount": 10,
    "Game": "Hello",
    "SpinValue": "Hello",
    "WageringRequirement": 10,
    "ExpirationDate": "2020-07-21T16:06:29.383+00:00",
    "BonusGrantedAmount": 10,
    "BonusReleasedAmount": 10,
    "Message": "Hello",
    "Action": "Hello",
    "PlayerTag": ["Hello"],
    "Category": "Hello",
    "Priority": "Hello",
    "DeviceOS": "Hello",
    "DeviceBrowser": "Hello",
    "TotalSession": 10,
    "TotalCoolOff": 10,
    "Score": 10,
    "Context": "Hello",
    "Count": 10,
    "TotalAmount": 10,
    "LimitPeriodId": "Hello",
    "LimitAmount": 10,
    "DepositPaymentMethod": "Hello",
    "DepositAmount": 10,
    "DepositReason": "Hello",
    "CoolOffs": "Hello",
    "Sessions": "Hello",
    "Answers": "Hello",
    "Devices": "Hello",
    "LimitsChanges": "Hello",
    "Withdraws": "Hello",
    "TagAssigned": "Hello",
    "TagCategory": "Hello",
    "ActionTag": "assigned", // assigned | unassigned
    "NoteCount": 10,
    "NoteCategoryCount": 10,
    "NoteCategory": "Hello",
    "Note": "Hello",
    "NotePriority": "Hello"
  }
}

For SMS sender

{
  "provider": {
    "apiKey": "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",
    "defaultLanguage": "ES"
  },
  "templateId": "5f1b48fdb5c7ce42db1c751a",
  "channel": 2, // for SMS sender
  "contacts": ["___SOME-PHONE-NUMBER___", "___SOME-PHONE-NUMBER___"],
  "placeholders": {
    "UserName": "Hello",
    "FirstName": "Angel",
    "LastName": "Hello",
    "Country": "CR",
    "City": "Hello",
    "PlayerLanguage": "ES",
    "AllowsEmails": true,
    "AllowsSMS": true,
    "EmailAddress": "test@test.com",
    "MobileNumber": "Hello",
    "Currency": "USD",
    "DateBirth": "2020-07-21T16:06:29.383+00:00",
    "Age": 10,
    "Gender": "f",
    "AccountStatus": "Hello",
    "RegistrationDate": "2020-07-21T16:06:29.383+00:00",
    "LastLogin": "2020-07-21T16:06:29.383+00:00",
    "FirstDeposit": "2020-07-21T16:06:29.383+00:00",
    "PostalCode": 10,
    "Nationality": "Hello",
    "PlayerId": "e961d6d7-c049-4ecc-9ab9-16f313bec170",
    "Amount": 10,
    "TransactionType": "Hello",
    "Date": "2020-07-21T16:06:29.383+00:00",
    "TransactionStatus": 10,
    "PaymentProvider": "Hello",
    "PaymentMethod": "Hello",
    "DepositId": "854cebe0-263b-48ab-978e-babe56be2908",
    "DepositCount": 10,
    "BonusName": "Hello",
    "BonusType": "Hello",
    "BonusId": 10,
    "FreeSpinAmount": 10,
    "Game": "Hello",
    "SpinValue": "Hello",
    "WageringRequirement": 10,
    "ExpirationDate": "2020-07-21T16:06:29.383+00:00",
    "BonusGrantedAmount": 10,
    "BonusReleasedAmount": 10,
    "Message": "Hello",
    "Action": "Hello",
    "PlayerTag": ["Hello"],
    "Category": "Hello",
    "Priority": "Hello",
    "DeviceOS": "Hello",
    "DeviceBrowser": "Hello",
    "TotalSession": 10,
    "TotalCoolOff": 10,
    "Score": 10,
    "Context": "Hello",
    "Count": 10,
    "TotalAmount": 10,
    "LimitPeriodId": "Hello",
    "LimitAmount": 10,
    "DepositPaymentMethod": "Hello",
    "DepositAmount": 10,
    "DepositReason": "Hello",
    "CoolOffs": "Hello",
    "Sessions": "Hello",
    "Answers": "Hello",
    "Devices": "Hello",
    "LimitsChanges": "Hello",
    "Withdraws": "Hello",
    "TagAssigned": "Hello",
    "TagCategory": "Hello",
    "ActionTag": "assigned", // assigned | unassigned
    "NoteCount": 10,
    "NoteCategoryCount": 10,
    "NoteCategory": "Hello",
    "Note": "Hello",
    "NotePriority": "Hello"
  }
}

Contact