klavyio manage k maill ists code example

Example: klavyio manage k maill ists

var settings = {
  "async": true,
  "crossDomain": true,
  "url": "https://manage.kmail-lists.com/ajax/subscriptions/subscribe",
  "method": "POST",
  "headers": {
    "content-type": "application/x-www-form-urlencoded",
    "cache-control": "no-cache"
  },
  "data": {
    "g": "{{LIST_ID}}",
    "$fields": "$first_name,$last_name,Favorite Color,Favorite Book,$source",
    "email": "{{email}}",
    "$first_name": "{{first_name}}",
    "$last_name": "{{last_name}}",
    "Favorite Color": "{{favorite_color}}",
    "Favorite Book": "{{favorite_book}}",
    "$source": "Custom Form"
  }
}
 
$.ajax(settings).done(function (response) {
  console.log(response);
});

Tags:

Php Example