How do I send user data from a custom pop-up to Shopify customers?

Hello, everyone!

We want to develop a pop-up on our homepage. When the user arrives at the homepage of our website, it will pop up. The Pop-up is like this:

https://shopify.zendesk.com/attachments/token/frDXuiUL2nT3hAh1DHntvSvqk/?name=image.png

We know there are many pop-up apps but most of them don’t support multi-languages.

So, we plan to develop the pop-up by ourselves. But we don’t know how to send the email data to Shopify > Customers, when customers enter their email address and click the button “Submit”

Does anyone know how to send the data? Or does Shopify provide the API to send the data?

Many Thanks.

To get an idea of the structure of code look at the newletter in the Dawn themes newsletter section https://github.com/Shopify/dawn/blob/main/sections/newsletter.liquid

Or any free shopify vintage theme

https://help.shopify.com/en/manual/online-store/themes/themes-by-shopify/vintage-themes/customizing-vintage-themes/theme-newsletter#add-a-newsletter-signup-section-to-your-online-store

Note that front end liquid theme forms cannot modify existing customers properties such as tags, where a customer is not the same thing as a contact. To do something like requires an app to consume the form submission and communicate with the backend.

Hello, Paul,

Thank you so much for this reply.

We don’t use the Shopify theme, our developers write the theme by themselves.

We tried to request the API of the section of the ”Customers”, below is our request code:

$.ajax({
url: ‘/contact#contact_form’,
type: ‘post’,
data: $(‘#subscriberForm’).serialize(),
dataType: ‘json’,
success: (res) => {
console.log(res)
}
});

but we got an error code 406.

Do you know the reason?

Many Thanks.