- Introduced a new `SettingsNotificationPage` component for managing newsletter subscriptions. - Added `NewsletterFormCard` to handle subscription status with user feedback through toast notifications. - Implemented `isSubscribedAction` to check user subscription status, enhancing user experience. - Updated localization files to include new messages for newsletter management in English and Chinese. - Enhanced sidebar with a new notification settings link for easy access to subscription preferences.
17 lines
522 B
TypeScript
17 lines
522 B
TypeScript
import { subscribeNewsletter, unsubscribeNewsletter, checkSubscribeStatus } from './provider/resend';
|
|
|
|
export const subscribe = async (email: string) => {
|
|
const subscribed = await subscribeNewsletter({ email });
|
|
return subscribed;
|
|
};
|
|
|
|
export const unsubscribe = async (email: string) => {
|
|
const unsubscribed = await unsubscribeNewsletter({ email });
|
|
return unsubscribed;
|
|
};
|
|
|
|
export const isSubscribed = async (email: string) => {
|
|
const subscribed = await checkSubscribeStatus({ email });
|
|
return subscribed;
|
|
};
|