smtp

package
v0.0.8 Latest Latest
Warning

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

Go to latest
Published: Dec 27, 2019 License: MIT Imports: 9 Imported by: 0

README

smtp

API endpoint

POST /fregata/v1/smtp

input params

{
  "from": "from@example.com",
  "to": [
    "to@example.com"
  ],
  "cc": [
    "cc@example.com"
  ],
  "subject": "subject",
  "body": "email body"
}

Documentation

Overview

Package smtp is used to send emails through SMTP

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ServiceHandler

func ServiceHandler(c Config) http.HandlerFunc

Types

type Config

type Config struct {
	Enabled  bool     `toml:"enabled"`
	Host     string   `toml:"host"`
	Port     int      `toml:"port"`
	Username string   `toml:"username"`
	Password string   `toml:"password"`
	From     string   `toml:"from"`
	To       []string `toml:"to"`
}

func NewConfig

func NewConfig() Config

func (Config) Validate

func (c Config) Validate() error

type Service

type Service struct {
	// contains filtered or unexported fields
}

func NewService

func NewService(c Config, l *log.Logger, r *mux.Router) *Service

Jump to

Keyboard shortcuts

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