Skip to main content
Version: 3.3.0

NewsletterUpdateContainer

Handles updating the list of newsletters the user is subscribed to.

Usage#

import React from "react";
import {
NewsletterUpdateContainer,
NewsletterUpdateList,
NewsletterUpdateButton,
Alert,
} from "@pelcro/react-pelcro-js";
import "@pelcro/react-pelcro-js/dist/pelcro.css";
export const customNewsletterUpdateView = () => {
return (
<NewsletterUpdateContainer
onSuccess={(userObject) => {
console.log(userObject);
}}
onFailure={(err) => {
console.error(err.message);
}}
>
<Alert />
<NewsletterUpdateList />
<NewsletterUpdateButton />
</NewsletterUpdateContainer>
);
};

Reference#

NewsletterUpdateContainer#

Props#

onSuccess#

(userObject) โ‡’ void

Callback function called when the newsletters subscriptions are updated succesfully.

onFailure#

(errorObject) โ‡’ void

Callback function called when updating the newsletters subscriptions fails.

Children components#

Alert#

Displays the relevant errors or success messages.


NewsletterUpdateList Required#

A selectable list of all available newsletters.


NewsletterUpdateButton Required#

Instance of Button

A button component that submits the selected newsletters.

Props#

name#

string?

The title displayed inside the button