> ## Documentation Index
> Fetch the complete documentation index at: https://docs.shootmail.app/llms.txt
> Use this file to discover all available pages before exploring further.

# Usage

> Method to send mail

After initializing the `Shootmail` client, use `shoot` method to send mail

```typescript theme={null}
import { Shootmail, type ShootMailConfig } from "shootmail";
const shootmail = new Shootmail(shootmailConfig);
shootmail.shoot(params);
```

### How to copy mail variables form playground

<video controls muted loop playsInline src="https://res.cloudinary.com/curead/video/upload/f_auto,q_auto/v1718774708/Shootmail/videos/send-mail-in-30s_gm0w9d.mp4" />

### Send Mail

```typescript theme={null}
const response = await shootmail.shoot({
    templateId: "kthiazpqofgnrtm",
    from: {
        name: "Shootmail",
        email: "noreply@mail.example.app"
    },
    provider: "resend",
    to: [{ email: "hi@example.com" }],
    subject: "Regarding your Shootmail subscription",
    variables: [...]
});
```

### Params

**templateId** `string` *required*

Template Id of the template you want to use. This can be copied from [Templates](https://shootmail.app/templates)

**delay** `number`

Schedule a message to some time in future. Pass delay in seconds. For example: to send after
7 days, `delay: 7*24*60*60`

**from** `Object` *required*

This should be the email verified with your email service

**properties**

**email** `string` *required*

This should be the email verified with your email service

**name** `string`

**provider** `string` *required*

Use `shootmail` here. If you are using some other email service, you can select that provider, [check docs](https://docs.shootmail.app/supported-providers.md).

**to** `Array` *required*

An array of email addresses to the people you want to send the mails to.

**properties**

**email** `string` *required*

**name** `string`

**subject** `string` *required*

Subject of the email

**variables** `Array` *required*

The variables to be passed to the template to build the email. You can copy this from the mail playground
and modify according to your needs. [See Video](https://docs.shootmail.app/usage#how-to-copy-mail-variables-form-playground)

### Schedule Mail

```typescript theme={null}
  const response = await shootmail.shoot({
      delay: 60 //seconds
      ...
  })
```

Schedule a message to some time in future. Pass delay in seconds. For example: to send after 7 days, `delay: 7*24*60*60`

### Undo Mail

```typescript theme={null}
const response = await shootmail.undoSchedule(requestId);
```

Here `requestId` is the one received in the response of the method `shootmail.shoot()`.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.