Malik docs
Installation & example

Installation

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 properties required to send e-mail.

NameTypeDescription
publicKeystringYour project's unique identifier.
subjectstringThe subject of the email.
bodystringThe body of the email (can be in raw HTML format).
replyTostringThe e-mail address of your customer so you would know who you should reply to.

Responses

Responses returned by Mailik.

StatusDescription
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://api.mailik.dev/graphql