Skip to main content

Setup

You will need a Amply (SendAmply) account. In Amply, create an Access Token from your account settings. In Courier, navigate to the Amply Integration page, enter your Access Token, From Email, and From Name, then click “Save.”

Profile Requirements

To deliver a message to a recipient over Amply, Courier must be provided the recipient’s email address. This value should be included in the recipient profile as email.
JSON
{
  "message": {
    // Recipient Profile
    "to": {
      "email": "alice@acme.com"
    }

    // ... rest of message definition
  }
}

Overrides

You can use a provider override to replace what we send to Amply’s Mail Send API. For example, you can use the following payload to override the sender name:
JSON
{
  "message": {
    "template": "NOTIFICATION_TEMPLATE_ID",
    "to": {
      "email": "alice@acme.com"
    },
    "providers": {
      "amply": {
        "override": {
          "config": {
            "fromName": "Acme Notifications"
          }
        }
      }
    }
  }
}
Everything inside of message.providers.amply.override will replace what we send to Amply’s Messages API. You can see all the available options by visiting Amply API docs.

Sending Attachments

To include an attachment in the email, you can use the following override:
{
  "message": {
    "template": "NOTIFICATION_TEMPLATE_ID",
    "to": {
      "email": "alice@acme.com"
    },
    "data": {
      "hello": "world"
    },
    "providers": {
      "amply": {
        "override": {
          "attachments": [
            {
              "filename": "billing.pdf",
              "contentType": "application/pdf",
              "data": "Q29uZ3JhdHVsYXRpb25zLCB5b3UgY2FuIGJhc2U2NCBkZWNvZGUh"
            }
          ]
        }
      }
    }
  }
}