The Contentful + Iterable integration brings the content you build in Contentful into Iterable for use in templates and campaigns, so you don't need to copy and paste it. Use it to send a content roundup of your newest articles, match products or articles to each customer's interests, or reuse the images your design team stores in Contentful across templates.
NOTE
Contentful can connect to Iterable in two ways:
-
As a Catalog sync (this article). Iterable copies your published Contentful content into catalogs. Use the Catalog sync to:
- Match products or articles to each customer's interests or location.
- Reuse Contentful images and other fields across many templates.
- Keep content in Iterable that updates when you publish, unpublish, or delete it in Contentful.
-
As a data feed. Iterable fetches an entry from Contentful when each message sends. Use a data feed to:
- Show the current content of a specific entry, such as a promotion or banner.
- Use entries that have several locales.
- Add Contentful content if your Iterable plan doesn't include Catalog.
To learn more, read Contentful + Iterable Integration (Data Feeds).
# In this article
- How the integration works
- Connection requirements
- Connecting Contentful to Iterable
- Catalog fields
- Next steps
-
Troubleshooting
- Finishing setup is blocked on Validation
- Finishing setup fails because a catalog field has a different type
- Finishing setup fails because Catalog isn't on your plan
- Content Selection doesn't list any content types
- Validation says it's ignoring some content types
- An entry doesn't appear in its catalog
# How the integration works
Iterable creates its own webhook in your selected Contentful space when you select Finish in setup. The webhook sends an event to Iterable each time an entry or asset in the space is published, unpublished, or deleted. Deleting the connection removes the webhook.
The integration syncs one Contentful environment and only published content, in the environment's default locale. It writes to these catalogs:
- One catalog for each content type you select, named
contentful-<contentTypeId>. Each entry becomes one catalog item. - One shared catalog,
contentful-assets, for the assets that your entries reference. Each asset becomes one catalog item.
To see the fields in each catalog, read Catalog fields.
# How content syncs
Iterable handles each Contentful event as follows:
- Publishing an entry of a selected content type adds or updates its catalog item, along with the assets that the entry's selected fields reference.
- Unpublishing or deleting an entry removes its catalog item.
- Publishing any asset in the environment adds or updates its item in
contentful-assets, whether or not an entry links to it. - Unpublishing or deleting an asset removes its item from
contentful-assets.
Before it changes a catalog, the integration checks the entry or asset with the Contentful Content Delivery API. It adds items only for published content, and removes them only after the content is no longer published.
Updates merge into the existing catalog item. When a selected field is empty in Contentful, the integration clears its value in Iterable.
# Webhook signing secret
The Webhook Signing Secret (Optional) setting on Connections takes your Contentful space's request verification secret. When it's set, the integration drops webhook requests that don't have a valid Contentful signature. When it's blank, the integration doesn't check signatures.
# How catalogs are created
Iterable creates any catalog that doesn't exist yet when you select Finish in setup. You don't need to create the catalogs in Iterable first.
Each content type's catalog is named contentful- followed by the content type
ID. Characters other than letters, numbers, and hyphens become hyphens. For
example, a content type with the ID blog_post syncs into
contentful-blog-post.
Selecting Finish also sets a data type for each selected field that doesn't have one yet. Fields that already have a type keep it.
# How existing entries are imported
Iterable imports the published entries of each newly selected content type, and the assets that their selected fields reference, when you select Finish in setup.
The import runs again for a content type when you select a new field for it and then select Finish, so existing catalog items get the field. Unchecking a field doesn't start an import.
# What isn't synced
The integration doesn't sync:
- Draft changes, or content that isn't published.
- Content in locales other than the Contentful environment's default locale.
- Content from other Contentful spaces or environments.
- Content types you don't select, and fields you uncheck. When you uncheck a field, existing catalog items keep its last value. When you deselect a content type, its catalog stays in Iterable.
- The fields of linked entries. A reference field holds the linked entry's ID.
- Fields that your content model disables for editing or omits from API responses.
- Entries and assets whose IDs start with a character other than a letter or number, or contain characters other than letters, numbers, and hyphens.
# Connection requirements
To connect Iterable with Contentful, you need:
- A Contentful Content Delivery API token for the space and environment that you sync.
- A server-side API key for the Iterable project that receives the content.
- Catalog added to your plan, which is required to sync content. You don't create the catalogs or their fields. The integration creates them when you finish setup. To add Catalog to your plan, talk to your Iterable customer success manager. Without Catalog, you can use a Contentful data feed instead.
# Connecting Contentful to Iterable
In Iterable, go to Integrations > Integrations Hub.
Find Contentful Catalog Sync, select Connect, and then select Add Connection.
-
On Connections:
- Connect your Contentful account.
- Enter your Iterable API key. (The Iterable connection's Primary Identifier doesn't affect this integration.)
- Under Content Delivery API Token, enter your Contentful Content Delivery API token.
- Optionally, under Webhook Signing Secret (Optional), enter your space's request verification secret. See Webhook signing secret.
On Contentful Space, select the space that the integration syncs.
On Contentful Access, select the environment that the integration syncs.
-
On Content Selection:
- Check the box for each content type to sync. The box's label names the catalog that receives the content type.
- Uncheck any fields you don't want in Iterable. All of a content type's fields are checked by default.
On Validation, review the catalog that receives each content type, and then select Finish. If something needs fixing, Validation lists the problem and you can't finish until it's resolved. See Finishing setup is blocked on Validation.
In Contentful, publish an entry of a selected content type. In Iterable, open the
contentful-<contentTypeId>catalog and confirm that it has an item whose ID matches the entry ID.
# Catalog fields
Each catalog item has these fields.
# Content type catalogs
Each item in a content type's catalog has the entry ID as its item ID, and one field for each selected field. Iterable field names are the Contentful field IDs.
The integration sets these Iterable data types for the following Contentful field types:
| Contentful field type | Iterable type | Value |
|---|---|---|
| Boolean | boolean | The field's value. |
| Date & time | date |
yyyy-MM-dd for a date without a time. Otherwise, yyyy-MM-ddTHH:mm:ss.SSSZ in UTC. |
| Decimal | double | The field's value. |
| Integer | long | The field's value. |
| JSON object* | None | The field's value. |
| List of short text or references | string | A list of text values, or a list of the linked entry or asset IDs. |
| Location | geo_location | The field's value. |
| Long text | string | The field's value. |
| Media | string | The linked asset's ID. The asset's details are in contentful-assets. |
| Reference | string | The linked entry's ID. |
| Rich text* | None | The field's value. |
| Short text | string | The field's value. |
* The integration doesn't set an Iterable data type for JSON object and rich text fields.
# Asset catalog
Each item in contentful-assets has the asset ID as its item ID, and the
following fields:
| Field | Type | Description |
|---|---|---|
contentType | string | The file's MIME type, such as image/png. |
fileName | string | The file's name. |
publishedAt | date | When the asset was last published. |
title | string | The asset's title. |
url | string | The file's URL, starting with https:. |
# Next steps
Once you have your Contentful content imported into Iterable, you can use it in your messages by referencing the catalog. To learn more about using catalogs, read Catalog Overview.
# Troubleshooting
# Finishing setup is blocked on Validation
Validation lists the problem and you can't finish until it's resolved. For example:
- No content type is selected. On Content Selection, check at least one content type, with at least one field.
- Two content types would share a catalog, because their IDs differ only in characters that become hyphens. Deselect all but one of them.
- A content type with the ID
assetswould sync intocontentful-assets. Deselect it.
# Finishing setup fails because a catalog field has a different type
Iterable can't change a catalog field's data type. If a selected field already has a different type in its catalog, finishing setup fails, and the message names the catalog and fields. Uncheck those fields on Content Selection, or delete the catalog in Iterable so the integration creates it again. Then select Finish again.
# Finishing setup fails because Catalog isn't on your plan
The integration syncs content into catalogs, so finishing setup fails if Catalog isn't on your plan. Talk to your Iterable customer success manager about adding Catalog to your plan, or use Contentful as a data feed instead.
# Content Selection doesn't list any content types
Content Selection shows "No published content types were found in this environment." Check the Contentful environment you selected on Contentful Access, and confirm that your Content Delivery API token is for that space and environment.
# Validation says it's ignoring some content types
After you change the Contentful space or environment, Validation can list content types that aren't in the new space and environment. Those content types don't sync. You can still finish setup.
# An entry doesn't appear in its catalog
Check that:
- The entry is published, in the Contentful environment you selected.
- Its content type is selected on Content Selection.
- Its ID contains only letters, numbers, and hyphens, and starts with a letter or number.
- If you entered a webhook signing secret, it matches your space's request verification secret.