• Send an email

    Parameters

    • email: Email

      Email-object describing the email to send

    Returns Promise<string | ApiFailReason>

    Returns a promise which can either fail (string with reason) or succeed (string with status)

    Throws

    When the API has not been properly configured using configure, an exception is thrown detailing the missing information.

    Example

    import { api } from "@hboictcloud/api";

    try {
    const data = await api.sendEmail({
    from: {
    name: "Group",
    address: "group@fys.cloud"
    },
    to: [
    {
    name: "Lennard Fonteijn",
    address: "l.c.j.fonteijn@hva.nl"
    }
    ],
    subject: "Just a test!",
    html: "<h1>Hello Lennard!</h1><p>This is an email :)</p>"
    });

    console.log(data);
    }
    catch(reason) {
    console.log(reason);
    }

Generated using TypeDoc