Skip to content

Transport mechanisms for delivering handshakejs authcodes to people.

Notifications You must be signed in to change notification settings

handshakejs/handshakejstransport

Repository files navigation

handshakejstransport

handshakejstransport

BuildStatus

Transport mechanisms for delivering handshakejs authcodes to people.

This library is part of the larger Handshake.js ecosystem.

Usage

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)
  }
}

Setup

Sets up the configuration.

options := handshakejstransport.Options{SmtpAddress: "smtp.sendgrid.net", SmtpPort: "587", SmtpUsername: "username", SmtpPassword: "password"}
handshakejstransport.Setup(options)

ViaEmail

Deliver authcode by way of email.

logic_error := handshakejstransport.ViaEmail(to, from, subject, text, html)
if logic_error != nil {
  fmt.Println(logic_error)
}

Installation

go get github.com/handshakejs/handshakejstransport

Running Tests

go test -v

About

Transport mechanisms for delivering handshakejs authcodes to people.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages