Skip to main content

Interface: EmailNamespace

Defined in: types.ts:1248

Email preference methods, available as allegro.email. All of them require an authenticated session.

Methods​

optIn()​

optIn(topic?): Promise<EmailPreferences>

Defined in: types.ts:1279

Opt the member back in to one topic by slug, or to all marketing email when no topic is given. Resolves with the updated preferences.

Parameters​

ParameterType
topic?string

Returns​

Promise<EmailPreferences>

Example​

await allegro.email.optIn('weekly-news');

optOut()​

optOut(topic?): Promise<EmailPreferences>

Defined in: types.ts:1268

Opt the member out of one topic by slug, or of all marketing email when no topic is given. Resolves with the updated preferences.

Parameters​

ParameterType
topic?string

Returns​

Promise<EmailPreferences>

Example​

await allegro.email.optOut('weekly-news');

preferences()​

preferences(): Promise<EmailPreferences>

Defined in: types.ts:1257

Fetch the member's marketing state and every topic with its subscription.

Returns​

Promise<EmailPreferences>

Example​

const { marketing, topics } = await allegro.email.preferences();