• Permissions

    In AWS, you will require an IAM Role associated with the email used that has the permissions in order to use this function:

    • SendEmail
    • SendRawEmail

    Parameters

    • options: Options

      This function uses the popular nodemailer internally to send emails. Please see the documentation for Message Configuration for available options.

    Returns Promise<SendEmailResult>

    const OneBlink = require('@oneblink/sdk')

    await OneBlink.sendEmail({
    subject: 'Message title',
    html: '<p>HTML version of the message</p>',
    from: {
    address: 'noreply@example.com',
    name: 'No Reply',
    },
    to: ['email@example.com'],
    cc: ['you@example.com'],
    bcc: ['not-you@example.com'],
    attachments: [
    {
    filename: pdfFileName,
    content: pdfData,
    contentType: 'application/pdf',
    encoding: 'binary',
    },
    ],
    })