email

package
v0.0.0-...-03d6fc4 Latest Latest
Warning

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

Go to latest
Published: Jan 23, 2019 License: BSD-3-Clause Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetViewActionMarkup

func GetViewActionMarkup(link, name, description string) (string, error)

GetViewActionMarkup returns a string that contains the required markup.

Types

type ClientConfig

type ClientConfig struct {
	ClientID     string `json:"client_id"`
	ClientSecret string `json:"client_secret"`
}

type ClientSecrets

type ClientSecrets struct {
	Installed ClientConfig `json:"installed"`
}

ClientSecrets is the structure of a client_secrets.json file that contains info on an installed client.

type GMail

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

GMail is an object used for authenticating to the GMail API server.

func NewFromFiles

func NewFromFiles(emailTokenCacheFile, emailClientSecretsFile string) (*GMail, error)

NewFromFiles creates a new GMail object authorized from the given files.

Creates a copy of the token cache file in /tmp since mounted secrets are read-only.

func NewGMail

func NewGMail(clientId, clientSecret, tokenCacheFile string) (*GMail, error)

NewGMail returns a new GMail object which is authorized to send email.

func (*GMail) Send

func (a *GMail) Send(senderDisplayName string, to []string, subject string, body string) error

Send an email.

func (*GMail) SendMessage

func (a *GMail) SendMessage(msg *Message) error

SendMessage sends the given Message.

func (*GMail) SendWithMarkup

func (a *GMail) SendWithMarkup(senderDisplayName string, to []string, subject string, body string, markup string) error

Send an email with gmail markup. Documentation about markups supported in gmail are here: https://developers.google.com/gmail/markup/ A go-to action example is here: https://developers.google.com/gmail/markup/reference/go-to-action

type Message

type Message struct {
	SenderDisplayName string
	To                []string
	Subject           string
	Body              string
}

Message represents a single email message.

Directories

Path Synopsis
Runs through a three-legged OAuth 2.0 flow to create a client_token.json file which contains a refresh token.
Runs through a three-legged OAuth 2.0 flow to create a client_token.json file which contains a refresh token.

Jump to

Keyboard shortcuts

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