Skip to contentSkip to navigationSkip to topbar
On this page
Looking for more inspiration?Visit the
(information)
You're in the right place! Segment documentation is now part of Twilio Docs. The content you are used to is still here—just in a new home with a refreshed look.

Loops (Actions) Destination


Loops(link takes you to an external page) is a modern email platform for SaaS, a better way to send marketing and transactional email.

You can use this Segment destination to create and update your Loops contacts and trigger email sending with events.

Loops maintains this destination. For any issues with the destination, contact their Support team.


Getting started

getting-started page anchor
  1. From the Segment web app, click Catalog, then click Destinations.
  2. Search for "Loops (Actions)" in the Destinations Catalog, and select the destination.
  3. Click Configure Loops.
  4. Select an existing Source to connect to Loops and click Next.
  5. On the Setup page, enter a name for your destination and click Create destination.
  6. Open Loops and generate an API key from Settings > API(link takes you to an external page). Click "Generate key" then click the "Copy to clipboard" icon.
  7. Open the Segment app, go to the Settings page inside your Loops destination, and paste your API key. Then, click "Save Changes".

Create or update contacts

create-or-update-contacts page anchor

You can create and update Loops contacts by using Segment's Identify method, like this:

1
analytics.identify("test-user-a5h7xb", {
2
email: "adam@loops.so",
3
firstName: "Adam",
4
favoriteColor: "blue",
5
favoriteNumber: 42
6
});

If the email address or user ID do not exist in your contacts, a new contact will be created. If the email address or user ID already exists, the existing contact will be updated with the data sent in the Identify call.

Go to the Mappings tab inside your Loops destination and click New Mapping. Select Create or update a contact.

It is important that you set up the data mapping properly in step 3 of the "Create or update a contact" form. This is where you can select which data is sent on to Loops and into which fields. Loops provides an example default mapping in the form, but you should make sure that you set up the mapping to capture the correct data in the correct fields (you may have some custom fields in Loops(link takes you to an external page) that the default mapping doesn't cover, for example).

You can pass any custom fields that you're using in Loops inside "Custom Contact Attributes".

Once you have completed the mapping you can send a test event. After you submit a test event, you can verify everything is set up correctly by looking for the contact on the Audience(link takes you to an external page) page in your Loops account.

Loops has a full tutorial for creating and updating contacts in the Loops docs(link takes you to an external page).


In Loops you can send emails triggered by events(link takes you to an external page). You can trigger these events from Segment by using the Track method, like this:

analytics.track("User Registered");

When you make a Track call, Segment will pass this event data on to Loops, which can then send emails based on email-sending triggers(link takes you to an external page) you've set up in your account.

To set up event sending with Segment, go to the Mappings tab inside your Loops destination and click New Mapping. Select Send Event.

In the next page, enter the name of the event you're tracking into the "Event Name" field (for example, "User Registered" from the example above). If you have not already created the contact in Loops, you need to include an email address in your mapping, as Loops requires a contact for each event.

Now you are able to send a test event. You can verify that the event was triggered properly in your Loops account from the Events(link takes you to an external page) page.

Read the tutorial for sending events in the Loops docs(link takes you to an external page).


Property nameTypeRequiredDescription
API Keystring
required

Your Loops API Key


Build your own Mappings. Combine supported triggers with the following Loops-supported actions:

(information)

Mapping limits per destination

Individual destination instances have support a maximum of 50 mappings.

Create or update a contact

create-or-update-a-contact page anchor

Create or update a contact in Loops

Create or update a contact is a Cloud action. The default Trigger is type = "identify"

Property nameTypeRequiredDescription
Contact Created DateDATETIME

Optional

Date the contact was created.


Custom Contact AttributesOBJECT

Optional

Contact attributes maintained by your team.


Contact EmailSTRING

Optional

Email address for the contact. This is required when creating new contacts.


First NameSTRING

Optional

The contact's given name.


Last NameSTRING

Optional

The contact's surname.


Mailing ListsOBJECT

Optional

Key-value pairs of mailing list IDs and a boolean denoting if the contact should be added (true) or removed (false) from the list. Input list IDs as keys on the right, and a boolean true or false value on the left.


SourceSTRING

Optional

The contact's source.


SubscribedBOOLEAN

Optional

Whether the contact is subscribed to email.


User GroupSTRING

Optional

The contact's user group.


User IDSTRING
required

User ID for the contact.

Send an event for a contact in Loops

Send Event is a Cloud action. The default Trigger is type = "track"

Property nameTypeRequiredDescription
Contact EmailSTRING

Optional

Email address for the contact.


Event NameSTRING
required

Name of the event.


User IDSTRING
required

User ID for the contact.


Contact PropertiesOBJECT

Optional

Optional properties that will be updated on the event's contact.


Event PropertiesOBJECT

Optional

Event-specific properties that can be included in emails triggered by this event.