Hi -
I’m working on a module and having a little bit of difficulty putting it together. A third party email has an opt out link. It will be something like XXX.com - XXX Sex Videos - Free Porn Movies.
I need to build a module that I can put on a page that will pull the email address out of the website url and submit it automatically via a form or something along the lines of this so that I can make a workflow that opts those people out of all emails.
Thank you
Hi there
Firstly you should split the email address from the url using the simple javascript function and save it to a variable.
function getLastPart(url)
{
const parts = url.split(‘=’); return parts.at(-1);
}
After that, you can use the Hubspot FORM API to submit the Hubspot form automatically by javascript API with the email value assigned to form field
https://legacydocs.hubspot.com/docs/methods/forms/advanced_form_options
If you need further assistance, please contact me.
Regards