Skip to content
Docs
/
Getting started

Getting started with Plunk

Getting started with Plunk is as easy as counting to three, let us show you how it's done!

1. Triggering an event

As you already know, Plunk is an event-based emailing tool, meaning everything starts with an event. There are a number of ways to trigger an event, below is a list of the most common ways to trigger an event:

  • Through the Plunk dashboard
  • Through the API
  • Through a third-party integration

Triggering an event through the Plunk dashboard

When you are first setting up an action you will need to have the event on hand. You may not want to integrate it into your applications just yet. In this scenario you can create a new event in the dashboard and then use it to create the new action.

Head over to the events tab in the Plunk dashboard and select new. You will be prompted to enter the name of the event and Plunk will automatically create it for you.

How to trigger an event through the Plunk dashboard

Triggering an event through the API

Most of your events will be sent through the Plunk API from either your applications or a third-party tool. When you are already sure about the event you want to trigger then you can use the API to trigger it the first time.

You will always need to integrate the API into your own project eventually but there is nothing wrong with using the dashboard to create the event first.


const res = await fetch('https://api.useplunk.com/v1', {
    method: "POST",
    headers: {
    "Content-Type": "application/json",
    "Authorization": "Bearer API_KEY",
    },
    body: JSON.stringify({
        event: "new-project",
        email: "hello@useplunk.com"
    }),
});

Triggering an event through a third-party integration

Plunk offers various integrations with third-party tools, maintained by the Plunk team or the community. You can use these integrations to send events to your Plunk dashboard.

A complete list of integrations can be found on the integrations page.

2. Creating a template

Templates are the blueprints of your emails. They are made up of a subject line and a body. Once you have designed and saved a template, you can link it together with your event in an action.

Templates are written in Markdown that is automagically converted to HTML that email clients can read. If you do not yet know how to to write Markdown, you can find a guide on Markdown on GitHub.

Templates also support variables, which are placeholders that will be replaced with data associated to the user when the template is sent. Variables are indicated with the {{ and }} characters with the name of the variable in between. For example: {{variable}}. A more in depth example can be found in the using variables in templates guide.

3. Creating an action

Actions are the glue between your events and your templates. When you trigger an event, Plunk will look at all actions associated with that event and cross-check them with events that were previously triggered by the same user.

Actions also contain some other parameters for you to configure. A complete list can be found below.

ParameterDescription
Run onceWhen toggled this action will only run once for each user. Once they have triggered it once, they can not trigger it again
DelayOnce a user has triggered all required events for an action, how long should the email be delayed. This can be minutes, hours or days with a maximum of 14 days
Last updated on August 27, 2022