sendgrid

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Jan 30, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type SendGrid

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

SendGrid struct holds necessary data to communicate with the SendGrid API.

func New

func New(apiKey, senderAddress, senderName string) *SendGrid

New returns a new instance of a SendGrid notification service. You will need a SendGrid API key. See https://sendgrid.com/docs/for-developers/sending-email/api-getting-started/

func (*SendGrid) AddReceivers

func (s *SendGrid) AddReceivers(addresses ...string)

AddReceivers takes email addresses and adds them to the internal address list. The Send method will send a given message to all those addresses.

func (SendGrid) Send

func (s SendGrid) Send(ctx context.Context, subject, message string) error

Send takes a message subject and a message body and sends them to all previously set chats. Message body supports html as markup language.

Jump to

Keyboard shortcuts

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