Skip to main content

How to Use Binding Groups

Last updated February 2020

Note: This Knowledge Base Article Is For SparkPost Enterprise Only

Introduction

Your SparkPost Enterprise environment was provisioned with your specific messaging needs and industry segmentation best practices in mind. Bindings enable routing of individual messages over a designated group of IP addresses. Each message sent must carry a binding designation.  Any transmission without a binding designation will be initially accepted, but will use a default binding group on your system which automatically blackholes all messages.

NoteMessages assigned to the default binding are never attempted, so in your webhook event data, or Message Events API data, you will see a single reception event on the default binding for messages that did not initially have a binding assignment, but you will not see a delivery event for these messages.

The bindings on your account were established during on-boarding and were communicated in the "Welcome to SparkPost Enterprise " document.  If you need assistance retrieving your bindings, please contact your Technical Account Manager.

How To

For REST injection, add a metadata key value pair in the transmission (json) at the transmission level:

"metadata": {"binding": "<value>"}

Note: Setting the binding assignment in the metadata carries the additional benefit of the binding group being included in webhook events that contain metadata. However, it is possible to set the binding in a REST transmission call by including the binding group value in the headers.X-Binding JSON object (nested under the content array) as follows:

"headers": {       "X-Binding": "binding"

For SMTP injection, add the following header:

X-binding: <value>

REST Sample

1{
2  "options" : {
3    "open_tracking" : true,
4    "click_tracking" : true
5  },
6"return_path" : "bounces-123@example.company.com",
7  "metadata" : {
8    "binding": "marketing"
9  },
10  "recipients" : [
11    {
12      "address" : {
13        "email": "joesmith@gmail.com",
14        "name" : "Joe Smith"
15      }
16    }
17  ],
18  "content" : {
19    "from" : {
20            "email" : "From Name <no-reply@example.company.com>"
21            },
22    "subject" : "Simple Binding Test",
23    "html" : "<p>hello world</p>
24<p><br>
25</p>",
26  }
27}

SMTP Sample

1X-MSYS-API: {"options" : {"open_tracking" : true, "click_tracking" : true}}
2X-binding: marketing
3Content-Type: text/html
4Subject: Simple Binding Test
5From: no-reply@mail.test.com
6To: testaccount@gmail.com
7
8<html>
9<body>
10hello world
11</body>
12</html>
Was this page helpful?