package
0.1.1
Repository: https://github.com/rubonnek/formailer.git
Documentation: pkg.go.dev

# README

Getting Started with Netlify

  1. Create a main.go in your project root:
package main

import (
	"github.com/aws/aws-lambda-go/lambda"
	"github.com/Rubonnek/formailer"
	"github.com/Rubonnek/formailer/handlers"
)

func main() {
	contact := formailer.New("Contact")
	contact.AddEmail(formailer.Email{
		ID:      "contact",
		To:      "[email protected]",
		From:    `"Company" <[email protected]>`,
		Subject: "New Contact Submission",
	})

	lambda.Start(handlers.Netlify(formailer.DefaultConfig))
}
  1. Update your netlify.toml:
[build]
    build="go build -o functions/formailer"
    functions="functions" 
[build.environment]
    GO_IMPORT_PATH="your project git location"
  1. Add your SMTP settings in you Netlify UI.

  2. Add a hidden input to your form.

<input type="hidden" name="_form_name" value="Contact">