Importing Unsubscribes From an External System
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.
-
Go to Settings, Column Mappings, and click New Column Mapping.
-
Name the mapping as Unsubscribe data mapping.
-
In Type of Data select Unsubscriptions.
-
Click Upload file and select a sample file of the data you will be uploading (a few rows are enough).
-
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:
-
Click Add Mapping and then save.
Create a Data Sync for Import
-
Go to Settings, Data Synchronization, and click New Synchronization.
-
Select Add Import.
-
Name the data sync as Daily Unsubscriptions Load.
-
From Data to import select Unsubscriptions.
-
In Configure column mapping, select the mapping you saved previously.
-
Choose API as source type.
-
Select the desired frequency and save.
-
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"⏎