var info = $('#account-message-info').data('info');
if (info.success != '') {
  notificationMsg(info.success, 'success');
}

$('#account-newsletter').on('click', function() {
  var $this = $(this);
  $.ajax({
    url: $this.data('newsletter-url'),
    type: 'POST',
    data: {newsletter: $this.val()},
    success: function(data) {
      if ($this.val() == '1') {
        $this.val('0');
      } else {
        $this.val('1');
      }
    }
  });
});

$('#account-feedback-whatsapp').on('click', function() {
  var $this = $(this);
  $.ajax({
    url: $this.data('feedback-whatsapp-url'),
    type: 'POST',
    data: {feedback_status: $this.val()},
    success: function(data) {
      if ($this.val() == '1') {
        $this.val('0');
      } else {
        $this.val('1');
      }
    }
  });
});