mailer

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Jan 24, 2019 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LogInfo

func LogInfo(msgid string, msgs ...interface{})

Types

type MailRequest

type MailRequest struct {
	Recipient  MailRequestEmailAddress `json:"recipient"`
	Payload    map[string]interface{}  `json:"payload"`
	Attachment *MailRequestAttachment  `json:"attachment,omitempty"`
	Body       []byte
	FromName   string
	Subject    string
	ID         string
}

func (*MailRequest) UnmarshalJSON

func (mr *MailRequest) UnmarshalJSON(jsonBytes []byte) error

type MailRequestAttachment

type MailRequestAttachment struct {
	Filename       string `json:"filename"`
	DecodedContent []byte `json:"contents"`
}

func (*MailRequestAttachment) UnmarshalJSON

func (a *MailRequestAttachment) UnmarshalJSON(jsonBytes []byte) error

type MailRequestEmailAddress

type MailRequestEmailAddress struct {
	Address       string `json:"address"`
	Name          string `json:"name"`
	ParsedAddress *mail.Address
}

func (*MailRequestEmailAddress) UnmarshalJSON

func (a *MailRequestEmailAddress) UnmarshalJSON(jsonBytes []byte) error

type MailerJSONResponse

type MailerJSONResponse struct {
	Status  string `json:"status"`
	Error   string `json:"error,omitempty"`
	Request string `json:"request"`
}

type MailerServer

type MailerServer struct {
	CaCert, ServerCert, ServerKey                  []byte
	SMTPServer, SMTPUser, SMTPPassword, FromDomain string
	SMTPPort                                       int
	// contains filtered or unexported fields
}
{
  "template": "registration",
  "lang": "en",
  "recipient": {
	"address": "email@address.com",
	"name": "Philip J. Fry"
  },
  "payload": {
    "user": {
      "firstname": "Philip J.",
      "lastname": "Fry",
      "apikey": "<some valid apikey>"
    },
    "box": {
      "id": "<some valid senseBox id>",
      "sensors": [
        {
          "title": "<some title>",
          "type": "<some type>",
          "id": "<some valid senseBox sensor id>"
        },
        ...
      ]
    }
  },
  "attachment": {
    "filename": "senseBox.ino",
    "contents": "<file contents in base64>"
  }
}

MailerServer wraps the https server and the SMTP daemon

func (*MailerServer) Start

func (mailer *MailerServer) Start() error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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