Skip to main content
Version: 3.5.2

NewsLetter

The newsletter modal is used to make the user subscribe to your newsletter.

Loading...
info

The title and subtitle of this modal is configured on every product on the platform.

Usage#

import React from "react";
import {
NewsLetter,
PelcroModalController,
usePelcro,
} from "@pelcro/react-pelcro-js";
import "@pelcro/react-pelcro-js/dist/pelcro.css";
export const MeterExample = () => {
const { switchView } = usePelcro();
return (
<>
<button onClick={() => switchView("newsletter")}>
Subscribe to our newsletter
</button>
<PelcroModalController>
<NewsLetter />
</PelcroModalController>
</>
);
};

Reference#

Props#

onDisplay#

() โ‡’ void

Callback function called when the modal is first displayed.

onClose#

() โ‡’ void

Callback function called when the modal is closed.

onSuccess#

(newsletterObject) โ‡’ void

Callback function called when the user subscribes to the newsletter succesfully.

onFailure#

(errorObject) โ‡’ void

Callback function called when the subscription fails.