api

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Nov 6, 2022 License: MPL-2.0 Imports: 3 Imported by: 0

README

Getting Started with Vercel

  1. Create a formailer.go in your project at ./api/:
package api

import (
	"net/http"

	"github.com/Rubonnek/formailer"
	"github.com/Rubonnek/formailer/handlers"
)

// Formailer handles all form submissions
func Formailer(w http.ResponseWriter, r *http.Request) {
	contact := formailer.New("Contact")
	contact.AddEmail(formailer.Email{
		ID:      "contact",
		To:      "[email protected]",
		From:    `"Company" <[email protected]>`,
		Subject: "New Contact Submission",
	})

	handlers.Vercel(formailer.DefaultConfig, w, r)
}
  1. Add your SMTP settings in you Vercel UI.
  2. Add a hidden input to your form.
<input type="hidden" name="_form_name" value="Contact">

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Formailer

func Formailer(w http.ResponseWriter, r *http.Request)

Formailer handles all form submissions

Types

This section is empty.

Jump to

Keyboard shortcuts

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