Hierarchy

Constructors

Methods

Constructors

Methods

  • Send email using Sendgrid integration

    Parameters

    Returns Promise<string>

    A promise that resolves to a success message

    Remarks

    This method requires Sendgrid API key. For enhanced security, it's strongly recommended to use TagoIO Secrets rather than hardcoding credentials.

    See

    https://help.tago.io/portal/en/kb/articles/secrets for TagoIO Secrets usage

    Example

    const sendgridService = new Services({ token: context.token }).sendgrid;
    const result = await sendgridService.send({
    from: "sender@company.com"
    to: "client@company.com",
    subject: "Reports",
    message: "Hello client, it's your report",
    sendgrid_api_key: "YOUR_SENDGRID_API_KEY"
    });
    console.log(result);

    Example

    // Using an array of recipients
    const result = await sendgridService.send({
    from: "sender@company.com"
    to: ["client1@company.com", "client2@company.com"],
    subject: "Reports",
    message: "Hello clients, it's your report",
    sendgrid_api_key: "YOUR_SENDGRID_API_KEY"
    });

    Example

    // Sending HTML content
    const result = await sendgridService.send({
    from: "sender@company.com"
    to: "client@company.com",
    subject: "Reports",
    html: "<p>Hello client, it's your <strong>report</strong></p>",
    sendgrid_api_key: "YOUR_SENDGRID_API_KEY"
    });

    Example

    // Using a template
    const result = await sendgridService.send({
    from: "sender@company.com"
    to: "client@company.com",
    template: { name: "my_template" },
    sendgrid_api_key: "YOUR_SENDGRID_API_KEY"
    });
  • Parameters

    Returns Promise<string>

  • Parameters

    Returns Promise<string>