• Log in
  • Sign up
  • Contact Us

Get in touch  

Developer Guides • Webhooks

Send a order confirmation email with Postmark using webhooks

Last updated: 05 Jul 2019

In this example we will clone the repository that handles the incoming webhook to send emails via Postmark and learn how to configure it to run locally.

Running locally

When using this example locally, it's recommended you use a service ngrok to tunnel your dev environment to the outside world.

Once you have the repo running locally, you'll want to add the integration via the Moltin Dashboard. The URL will be the one provided by ngrok.

1. Download the example

Clone the repository:

git clone git@github.com:moltin/integration-examples.git

Install the dependencies with Yarn

cd integration-examples/order-confirmation-email
yarn

2. Configure Postmark

In this example we will use Postmark to send our emails. They also take care of hosting the email template.

Once you've signed up to Postmark, create a new server and add a new template with the following code:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <title></title>
    <style type="text/css"></style>
  </head>
  <body>
    <p>
      Thank you for your order . The total for your order was
      
    </p>
    <table>
      <thead>
        <tr>
          <th>Name</th>
          <th>Quantity</th>
          <th>Total</th>
        </tr>
      </thead>
      <tbody>
        {