sendgrid

command module
v0.0.0-...-8835833 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 4, 2023 License: Apache-2.0 Imports: 7 Imported by: 0

README


{ "image": "direktiv/sendgrid", "desc": "A simple Twilio sendgrid client" }

Sendgrid

Direktiv

An example workflow of using the container in a workflow on Direktiv. The message content can be defined by three different values:

  • message: plain text message
  • html-message: html content as message
  • template & template-data: template defines a template in golang templating format and template-data defines the input data for the template.

Templating example

template: "hello {{.name}}! {{range .items}}{{.}} {{end}}"
template-data:
  name: Testname
  items:
  - one
  - two

Workflow Example

description: send emails
functions:
- id: mail
  image: direktiv/sendgrid
  type: reusable
states:
- id: sendemail
  type: action
  action:
    function: mail
    secrets: ["SENDGRID"]
    input:
      sender-name: John Sender
      sender-email: sender@sendit.xyz
      subject: "test"
      message: "this is a message"
      recv-name: Jim Receiver
      recv-email: receiver@abcdefgh.abc
      apikey: jq(.secrets.SENDGRID)

Input

Sends an email via Sendgrid according to the input object:

input:
  sender-name: John Sender
  sender-email: sender@sendit.xyz
  subject: "test"
  message: "this is a message"
  recv-name: Jim Receiver
  recv-email: receiver@abcdefgh.abc
  apikey: jq(.secrets.SENDGRID)

Output

No output is provided on success.

Error

In the case that an error is encountered, it will present in the following format:

{
    "errorCode": "com.sendgrid.error",
    "errorMsg": "Something went wrong"
}

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL