Skip to content

Share

Public surface (share): presentation · email

Both methods are synchronous (fire analytics/capturedata events). presentation is a no-op outside Mobile Locker after validating args.

interface ShareRecipient {
email: string
name?: string
}

Top-level constants on the default export (also used by share):

mobilelocker.notificationLevels
// NOTIFY_NONE: 0, NOTIFY_FIRST: 1, NOTIFY_EVERY: 2, NOTIFY_WEEKLY: 3, NOTIFY_MONTHLY: 4
presentation(
recipients: ShareRecipient[],
notificationLevel?: number, // default 2 (NOTIFY_EVERY)
sendReminders?: boolean, // default true
): void

Throws InvalidArgument if recipients is empty or any recipient lacks email.

import mobilelocker from '@mobilelocker/javascript-sdk'
mobilelocker.share.presentation(
[{ email: 'jane@example.com', name: 'Jane' }],
mobilelocker.notificationLevels.NOTIFY_FIRST,
true,
)
email(
to: string | { name?: string; email: string },
subject: string,
body?: string | null, // default null
attachment?: string | null, // default null
template?: string | null, // default null
formData?: unknown, // default null
): void
mobilelocker.share.email(
{ name: 'Jane', email: 'jane@example.com' },
'Thanks for stopping by',
'It was great meeting you at the conference.',
)
// string recipient also valid
mobilelocker.share.email('jane@example.com', 'Subject', 'Body text')