Installation & example

Instalation

Implementation of the Mailik library for web applications.

npm install @mailik/sdk

Example

Basic example on how to use Mailik.

import Mailik from "@mailik/sdk";

type MailInputType = { body: string; subject: string; replyTo: string };

const handleSubmit = (values: MailInputType) => {
  const res = await Mailik(YOURS_API_KEY).send({
    replyTo: data.email,
    body:`
          Name: ${data.name},
          Message: ${data.message},
          Phone:${data.phone}
        `,
    subject: "Mail subject",
    });
  }

Props

Basic properities required to send e-mail.

Name Type Description
publicKey string Your project's unique identifier.
subject string The subject of the email.
body string The body of the email (can be in raw HTML format).
replyTo string The e-mail address of your customer so you would know who you should reply to.

Responses

Responses returned by Mailik.

Status Description
response.status === "OK" The e-mail was sent successfully.
response.status === "FAILED" The request was rejected by the backend.

Schema URL

Mailik's GraphQL schema is available at https://mailik.aexol.work/graphql