email

package
v1.6.0 Latest Latest
Warning

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

Go to latest
Published: May 6, 2020 License: BSD-3-Clause Imports: 7 Imported by: 0

README

email plugin

This plugin send an email.

Configuration

Fields Description
smtp_username username of SMTP server
smtp_password password of SMTP server
smtp_port port of SMTP server
smtp_hostname hostname of SMTP server
smtp_skip_tls_verif Skip or not TLS insecure verify
from_address from which email you want to send the message
from_name from which name you want to send the message
to receiver(s) of your email
subject subject of your email
body content of your email

Example

An action of type email requires the following kind of configuration:

action:
  type: email
  configuration:
    # mandatory, string
    smtp_username: {{.config.smtp.username}}
    # mandatory, string
    smtp_password: {{.config.smtp.password}}
    # mandatory, string as uint
    smtp_port: {{.config.smtp.port}}
    # mandatory, string
    smtp_hostname: {{.config.smtp.hostname}}
    # optional, string as boolean
    smtp_skip_tls_verify: "true"
    # mandatory, string
    from_address: foo@example.org
    # optional, string
    from_name: uTask bot
    # mandatory, string collection
    to: [bar@example.org, hey@example.org]
    # mandatory, string
    subject: Hello from µTask
    # mandatory, string
    body: |
      I love baguette

Note

The plugin returns an object to reuse the parameters in a future component:

{
  "from_address":"foo@example.org",
  "from_name":"uTask bot",
  "to": ["bar@example.org", "hey@example.org"],
  "subject":"Hello from µTask",
  "body":"I love baguette"
}

Sensitive data should be retrieved from configstore and accessed through {{.config.[itemKey]}} rather than hardcoded in your template.

Resources

The email plugin declares automatically resources for its steps:

  • socket to rate-limit concurrent execution on the number of open outgoing sockets
  • url:smtp_hostname (where smtp_hostname is the outgoing SMTP server of the plugin configuration) to rate-limit concurrent execution on a specific outgoing SMTP server

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Plugin = taskplugin.New("email", "0.2", exec,
		taskplugin.WithConfig(validConfig, Config{}),
		taskplugin.WithResources(resourcesemail),
	)
)

the email plugin send email

Functions

This section is empty.

Types

type Config

type Config struct {
	SMTPUsername      string `json:"smtp_username"`
	SMTPPassword      string `json:"smtp_password"`
	SMTPPort          string `json:"smtp_port"`
	SMTPHostname      string `json:"smtp_hostname"`
	SMTPSkipTLSVerify string `json:"smtp_skip_tls_verify,omitempty"`
	// contains filtered or unexported fields
}

Config is the configuration needed to send an email

Jump to

Keyboard shortcuts

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