Transport mechanisms for delivering handshakejs authcodes to people.
This library is part of the larger Handshake.js ecosystem.
package main
import (
"fmt"
handshakejstransport "github.com/handshakejs/handshakejstransport"
)
func main() {
options := handshakejstransport.Options{"smtp.sendgrid.net", "587", "username", "password"}
handshakejstransport.Setup(options)
logic_error := handshakejstransport.ViaEmail("[email protected]", "[email protected]", "Your authcode is 1234", "This is the text of the email", "This is the <b>html</b> of the email")
if logic_err != nil {
fmt.Println(logic_error)
}
}
Sets up the configuration.
options := handshakejstransport.Options{SmtpAddress: "smtp.sendgrid.net", SmtpPort: "587", SmtpUsername: "username", SmtpPassword: "password"}
handshakejstransport.Setup(options)
Deliver authcode by way of email.
logic_error := handshakejstransport.ViaEmail(to, from, subject, text, html)
if logic_error != nil {
fmt.Println(logic_error)
}
go get github.com/handshakejs/handshakejstransport
go test -v