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 — same as id, SEO friendly

    • type — either “StandaloneCampaign” or “DoubleSidedDealCampaign”

    • new_customer — whether the Advocate has to be a new customer to see the campaign

    • origin_min_age — seconds passed since the first site visit before the Advocate can see the campaign

    • origin_max_age — seconds passed since the first site visit during which the Advocate can see the campaign

    • joinable_category_names — categories of origins that trigger the campaign

    • tag_names — array of campaign’s tags

  • recipient — subhash of parameters describing the recipient

    • email — recipient’s email address

    • phone_number — recipient’s phone number (optional)

    • first_name — recipient’s first name (optional)

    • last_name — recipient’s last name (optional)

    • username — recipient’s username (optional)

    • sub_choice — subscription choice (optional, present only if the form included subscription checkbox)

    • subscribed_at — date recipient has subscribed (deprecated; use opted_in_at instead)

    • opted_in_at — date recipient has subscribed (optional)

    • phone_opted_in_at — date recipient has subscribed with email (optional)

    • unsubscribed_at — date recipient has unsubscribed with phone number (optional)

    • custom_properties — hash of recipient’s custom properties (optional)

    • is_loyalty_member — whether the recipient participates in loyalty program

    • loyalty_member — details of the recipient as a loyalty program participant (optional)

    • referral_counts — referral counts of recipient as Advocate

      • total — created referrals count

      • approved — approved referrals count

      • pending — count of waiting for approval referrals

    • gender [deprecated]

  • 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"],
    "joinable_category_names": ["affiliate_member"],
    "origin_min_age": null,
    "origin_max_age": null,
    "new_customer": null
  },
  "recipient": {
    "first_name": "Bob",
    "last_name": "Smith",
    "email": "referrer@example.com",
    "phone_number": "+12025551111",
    "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",
    "phone_opted_in_at": "2018-09-27T22:55:40.610+03:00",
    "sub_choice": true,
    "custom_properties": {},
    "referral_counts": {
      "total": 0,
      "approved": 0,
      "pending": 0
    },
    "is_loyalty_member": false,
    "loyalty_member": null,
    "gender": null
  },
  "email_type": "notifier_offers_email"
}

cURL example

curl <url> \
     -d "key=<key>" \
     -d "site=<site>" \
     -d "type=check_unsubscribe_web_hook" \
     -d "extras={}" \
     -d 'payload={"campaign":{"id":509365458,"type":"StandaloneCampaign","cached_slug":509365458,"tag_names":["default"],"joinable_category_names":["affiliate_member"],"origin_min_age":null,"origin_max_age":null,"new_customer":null},"recipient":{"first_name":"Bob","last_name":"Smith","email":"referrer@example.com","phone_number":"+12025551111","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","phone_opted_in_at":"2018-09-27T22:55:40.610+03:00","sub_choice":true,"custom_properties":{},"referral_counts":{"total":0,"approved":0,"pending":0},"is_loyalty_member":false,"loyalty_member":null,"gender":null},"email_type":"notifier_offers_email"}'