ses

package module
v0.0.0-...-ea21c6f Latest Latest
Warning

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

Go to latest
Published: Jan 13, 2018 License: MIT Imports: 5 Imported by: 0

README

ses-go

A simple wrapper for AWS SES in golang to send email

Sending an email
package main

import (
	"fmt"

	"github.com/srajelli/ses-go"
)

func main() {
	ses.SetConfiguration(aws_key_id, aws_secret_key, aws_region)
	
	emailData := ses.Email{
		To:      "someone@example.com",
		From:    "me@example.com",
		Text:    "Hi this is the text message body",
		Subject: "Sending email from aws ses api",
		ReplyTo: "me@example.com",
	}

	resp := ses.SendEmail(emailData)

	fmt.Println(resp)
}

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SendEmail

func SendEmail(emailData Email) *ses.SendEmailOutput

*********************************************************************

create and send text or html email to single receipents.
@returns resp *ses.SendEmailOutput

func SetConfiguration

func SetConfiguration(aws_key_id string, aws_secret_key string, aws_region string)

*********************************************************************

aws configuration

Types

type Email

type Email struct {
	From    string // From source email
	To      string // To destination email(s)
	Subject string // Subject text to send
	Text    string // Text is the text body representation
	HTML    string // HTMLBody is the HTML body representation
	ReplyTo string // Reply-To email(s)
}

Email options. credits : https://github.com/tj/go-ses

Jump to

Keyboard shortcuts

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