Created
October 17, 2023 18:11
-
-
Save abediali/99c52fbc095fc9860fc88c3c0fb87c58 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
params = { | |
email: data.email, | |
"list_id": xxxx, | |
"first_name": data.firstName, | |
"last_name": data.lastName, | |
"$source": source[type], | |
"$fields": '$consent,$source', | |
"$consent": "web", | |
} | |
const urlData = new URLSearchParams(params) | |
fetch(`https://manage.kmail-lists.com/ajax/subscriptions/subscribe`, { | |
method: 'POST', | |
body: urlData, | |
}) | |
.then(async response => { | |
setSuccess(true) | |
}) | |
.catch(error => { | |
setError('root', { | |
type: 'submit', | |
error.message, | |
}) | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment