2017-03-28 16:16:20 +00:00
|
|
|
package main
|
|
|
|
|
|
|
|
import (
|
|
|
|
"github.com/matcornic/hermes"
|
|
|
|
)
|
|
|
|
|
2017-03-28 16:41:38 +00:00
|
|
|
type receipt struct {
|
2017-03-28 16:16:20 +00:00
|
|
|
}
|
|
|
|
|
2017-03-28 16:41:38 +00:00
|
|
|
func (r *receipt) Name() string {
|
2017-03-28 16:16:20 +00:00
|
|
|
return "receipt"
|
|
|
|
}
|
|
|
|
|
2017-03-28 16:41:38 +00:00
|
|
|
func (r *receipt) Email() hermes.Email {
|
2017-03-28 16:16:20 +00:00
|
|
|
return hermes.Email{
|
|
|
|
Body: hermes.Body{
|
|
|
|
Name: "Jon Snow",
|
|
|
|
Intros: []string{
|
|
|
|
"Your order has been processed successfully.",
|
|
|
|
},
|
|
|
|
Table: hermes.Table{
|
|
|
|
Data: [][]hermes.Entry{
|
|
|
|
{
|
2017-03-28 16:34:01 +00:00
|
|
|
{Key: "Item", Value: "Golang"},
|
|
|
|
{Key: "Description", Value: "Open source programming language that makes it easy to build simple, reliable, and efficient software"},
|
2017-03-28 16:16:20 +00:00
|
|
|
{Key: "Price", Value: "$10.99"},
|
|
|
|
},
|
|
|
|
{
|
2017-03-28 16:34:01 +00:00
|
|
|
{Key: "Item", Value: "Hermes"},
|
|
|
|
{Key: "Description", Value: "Programmatically create beautiful e-mails using Golang."},
|
2017-03-28 16:16:20 +00:00
|
|
|
{Key: "Price", Value: "$1.99"},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
Columns: hermes.Columns{
|
|
|
|
CustomWidth: map[string]string{
|
|
|
|
"Item": "20%",
|
|
|
|
"Price": "15%",
|
|
|
|
},
|
|
|
|
CustomAlignement: map[string]string{
|
|
|
|
"Price": "right",
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
Actions: []hermes.Action{
|
|
|
|
{
|
|
|
|
Instructions: "You can check the status of your order and more in your dashboard:",
|
|
|
|
Button: hermes.Button{
|
|
|
|
Text: "Go to Dashboard",
|
|
|
|
Link: "https://hermes-example.com/dashboard",
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
}
|
|
|
|
}
|