Importing Unsubscribes From an External System

Last updated:

If you store member or customer subscription preferences in an external system, you can load them into Prisma using data syncs.

Create a Column Mapping for Data Loading

These are the fields about unsubscriptions that you can import from an external system:

  • Customer Id: the identifier for the customer who unsubscribed
  • Campaign Name: the campaign the customer is unsubscribing from (optional)
  • Category Name: category the customer is unsubscribing from (optional)
  • Group Name: the group the customer is unsubscribing from (optional)
  • Channel: the channel (:mail, :pushn, :sms, or :all) the customer is unsubscribing from (optional)

At least one of the optional fields should be present for the member or customer to unsubscribe from something.

  1. Go to Settings, Column Mappings, and click New Column Mapping.

  2. Name the mapping as Unsubscribe data mapping.

  3. In Type of Data select Unsubscriptions.

  4. Click Upload file and select a sample file of the data you will be uploading (a few rows are enough).

  5. Map the columns per the above field description:

    In the following image an unsubscribe file was selected where customers were unsubscribed from the Informativo, Ventas, and Promociones categories:

  6. Click Add Mapping and then save.

Create a Data Sync for Import

  1. Go to Settings, Data Synchronization, and click New Synchronization.

  2. Select Add Import.

  3. Name the data sync as Daily Unsubscriptions Load.

  4. From Data to import select Unsubscriptions.

  5. In Configure column mapping, select the mapping you saved previously.

  6. Choose API as source type.

  7. Select the desired frequency and save.

  8. Once the data sync is saved, select the upload url from the configuration.

As you see, it has the format https://[server]:[port]]/api/data-sync/import/[your-token].

If you need to manually test the file import, you can do it using the link and the wget or curl command-line tools like so:

curl -F file=@/Users/guilespi/Downloads/unsubscribes-2.csv http://example.com:8080/api/data-sync/import/6179c4cf-7327-419d-a816-21e7250a3a5a

which should output:

"File queued"⏎