go-sendmail

command module
v0.0.0-...-0c40063 Latest Latest
Warning

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

Go to latest
Published: Feb 16, 2020 License: MIT Imports: 2 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

Go-sendmail

A simple AWS Lambda function written in Go to send emails using Sendgrid

Requirements
  • Sendgrid account
  • AWS
  • aws-cli
Up and Running
Configure

Configure the lambda.json with your account information

{
    "FunctionName": "go-sendmail",
    "Runtime": "go1.x",
    "Role": "arn:aws:iam::{{ YOUR_AWS_ACCOUNT_ID }}:role/{{ YOUR_ROLE_NAME }}",
    "Handler": "main",
    "Description": "A simple AWS Lambda function written in Go to send emails using Sendgrid",
    "Timeout": 300,
    "MemorySize": 128,
    "Publish": true,
    "Environment": {
        "Variables": {
            "SENDGRID_API_KEY": "{{ YOUR_API_KEY }}"
        }
    },
    "Tags": {
        "Name": "go-sendmail"
    }
}
Deploy

Deploy the function with aws-cli

GOOS=linux go build
zip main.zip go-sendmail
aws lambda create-function \
  --region us-east-1 \
  --zip-file fileb://main.zip \
  --cli-input-json file://lambda.json

Or deploy using the AWS Console.

Invoke

Invoke the function with aws-cli

aws lambda invoke \
  --region us-east-1 \
  --function-name go-sendmail \
  --log-type Tail \
  --payload file://invoke-payload.json \
  lambda-response

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
Package mail provides a interface to interact
Package mail provides a interface to interact
Package models provides all the structs used in the project Package models provides all the structs used in the project
Package models provides all the structs used in the project Package models provides all the structs used in the project

Jump to

Keyboard shortcuts

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