Embed a newsletter form directly into any container on your page. Choose between stacked and inline
layouts:
// Inline layout (email + button side by side)
CuoralNewsletter.embed("#my-container", {
layout: "inline",
color: "#6366f1",
});
// Stacked layout with name fields
CuoralNewsletter.embed("#my-container", {
layout: "stacked",
showName: true,
title: "Stay updated",
color: "#059669",
});
Programmatic
subscribe()
For custom forms — just pass the email and get the result. Build your own UI, use our API.
// Use with your own custom form
const result = await CuoralNewsletter.subscribe({
email: "user@example.com",
firstName: "John",
lastName: "Doe",
tags: ["custom-form"],
});
if (result.status) {
console.log("Success!", result.data);
} else {
console.error("Error:", result.message);
}