Notifications API client for the Mosaia SDK

Provides email notification functionality for sending emails through the Mosaia platform. This is useful for sending transactional emails, notifications, and other communications.

import { Mosaia } from 'mosaia-node-sdk';

const mosaia = new Mosaia({ apiKey: 'your-api-key' });
const notifications = mosaia.notifications;

// Send an email
const result = await notifications.sendEmail({
to: 'user@example.com',
subject: 'Welcome!',
text: 'Welcome to our platform!',
html: '<h1>Welcome!</h1><p>Welcome to our platform!</p>'
});

Constructors

Methods

Constructors

Methods

  • Send an email notification

    Sends an email through the Mosaia platform's notification service. Supports both plain text and HTML email formats.

    Parameters

    Returns Promise<NotificationResponseInterface>

    Promise resolving to notification response

    // Send plain text email
    const result = await notifications.sendEmail({
    to: 'user@example.com',
    subject: 'Password Reset',
    text: 'Your password reset code is: 123456'
    });
    // Send HTML email
    const result = await notifications.sendEmail({
    to: 'user@example.com',
    subject: 'Welcome!',
    html: '<h1>Welcome!</h1><p>Thank you for joining!</p>'
    });

    When email sending fails or required fields are missing