Check Unsubscribe Webhook

Talkable Check Unsubscribe Webhook is used to ensure emails are not sent from Talkable to user email addresses who have unsubscribed from the client side. This is an optional functionality. Note: users do have the ability to unsubscribe from Talkable referral related emails at any time from those emails directly.

When does Talkable call the Check Unsubscribe Webhook?

Talkable Check Unsubscribe Webhook is triggered on every attempt to send an otherwise valid customer email, aimed at checking if the email is also valid on merchant side.

Important

If this Check Unsubscribe Webhook is used, the response JSON returned by merchant must contain the following fields:

{ "result": { "unsubscribed": true } }

The ‘unsubscribed’ field should have a boolean value, representing unsubscribed status according to the merchant info.

Payload parameters provided

  • campaign — subhash of parameters describing the campaign
    • id — unique campaign ID
    • cached_slug — unique SEO friendly ID
    • type — either “StandaloneCampaign” or “DoubleSidedDealCampaign”
    • tag_names — array of campaign’s tags
  • recipient — subhash of parameters describing the recipient
    • first_name — recipient’s first name
    • last_name — recipient’s last name
    • email — recipient’s email address
    • username — recipient’s username
    • unsubscribed_at — date recipient has unsubscribed
    • subscribed_at — date person has subscribed (deprecated; use opted_in_at instead)
    • opted_in_at — date recipient has subscribed
    • sub_choice — subscription choice
    • custom_properties — hash of recipient’s custom properties (optional)
  • email_type — described view category

View categories

View category can be one of the following:

  • notifier_offers_email
  • notifier_offers_share_via_email
  • notifier_offers_share_via_email_reminder
  • advocate_rewards_confirmation
  • advocate_rewards_paid
  • friend_rewards_paid

Sample payload

{
  "campaign": {
    "id": 509365458,
    "type": "StandaloneCampaign",
    "cached_slug": 509365458,
    "tag_names": ["default"],
    "origin_min_age": null,
    "origin_max_age": null,
    "new_customer": null
  },
  "recipient": {
    "first_name": "Bob",
    "last_name": "Smith",
    "email": "referrer@example.com",
    "username": "username",
    "unsubscribed_at": null,
    "subscribed_at": "2018-09-27T22:55:40.610+03:00",
    "opted_in_at": "2018-09-27T22:55:40.610+03:00",
    "sub_choice": true
  },
  "email_type": "notifier_offers_email"
}

cURL example

curl --data 'key=<key>&payload={"campaign":{"id":509365458,"type":"StandaloneCampaign","cached_slug":509365458,"tag_names":["default"],"origin_min_age":null,"origin_max_age":null,"new_customer":null},"recipient":{"first_name":"Bob","last_name":"Smith","email":"referrer@example.com","username":"username","unsubscribed_at":null,"subscribed_at":"2018-09-27T22:55:40.610+03:00","opted_in_at":"2018-09-27T22:55:40.610+03:00","sub_choice":true},"email_type":"notifier_offers_email"}' <url>