Skip to content

sendgrid

⚠️ DEPRECATION WARNING

This component is deprecated and will be removed in a future version of Nappai. Please migrate to the recommended alternative components.

This component lets you send emails directly through SendGrid from your Nappai dashboard.
You simply enter the recipients, subject, body, and any attachments, and the component takes care of the rest.

How it Works

When you run the component, it first checks that you have a valid SendGrid access token.
If the token is present, it builds an email message using the values you entered:

  1. Recipients – the “To” addresses you list.
  2. CC / BCC – optional carbon‑copy and blind‑carbon‑copy addresses.
  3. Subject & Body – the main content of the email.
  4. Attachments – any files you specify are read, base64‑encoded, and attached to the message.

The component then calls the SendGrid API (sg_api.send(message)).
If the API returns a status code of 202, the email was accepted for delivery and the component outputs true; otherwise it outputs false.

Inputs

Input Fields

  • Mail Configuration: A data object that can pre‑populate the email fields (to, cc, bcc, subject, body, sender, attachments).
  • Attachments: List of file paths to attach to the email.
  • BCC: List of blind carbon‑copy addresses.
  • Body: The main text of the email.
  • CC: List of carbon‑copy addresses.
  • Sender: The email address that appears as the sender.
  • Subject: The email subject line.
  • Recipient: (Required) List of primary email addresses to receive the message.

Outputs

  • Mail Status: A boolean value (true if the email was accepted by SendGrid, false otherwise).
    This can be used to trigger follow‑up actions, such as logging success or retrying on failure.

Usage Example

  1. Drag the SendGrid component onto your workflow.
  2. In the Recipient field, type alice@example.com, bob@example.com.
  3. Enter a subject like Monthly Report.
  4. Paste the body text or use a template variable.
  5. (Optional) Add a PDF report to Attachments.
  6. Connect the Mail Status output to a Log component to record whether the email was sent.

When you run the workflow, the component will send the email through SendGrid and output true if the message was accepted.

  • Send Email via SMTP – another way to send emails if you prefer using your own mail server.
  • Email Template Builder – create reusable email layouts that can be passed to this component.

Tips and Best Practices

  • Keep the Recipient list short to avoid hitting SendGrid’s rate limits.
  • Use the Mail Configuration data object to reuse common email settings across multiple workflows.
  • Store your SendGrid API key in Nappai’s secure credential store rather than hard‑coding it.
  • Test with a single test address before sending to a large group.

Security Considerations

  • The component requires a valid SendGrid API key. Store this key securely in Nappai’s credential manager.
  • Avoid exposing the API key in logs or error messages.
  • If you use attachments, ensure they are from trusted sources to prevent malicious files from being sent.