Skip to content

Commit d447d42

Browse files
committed
Fix services
1 parent d4712f4 commit d447d42

14 files changed

Lines changed: 954 additions & 32 deletions

api/go.mod

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ require (
1717
github.com/google/uuid v1.3.0
1818
github.com/hirosassa/zerodriver v0.1.2
1919
github.com/joho/godotenv v1.4.0
20+
github.com/jordan-wright/email v4.0.1-0.20210109023952-943e75fe5223+incompatible
21+
github.com/matcornic/hermes/v2 v2.1.0
2022
github.com/nyaruka/phonenumbers v1.1.0
2123
github.com/palantir/stacktrace v0.0.0-20161112013806-78658fd2d177
2224
github.com/pkg/errors v0.9.1
@@ -44,8 +46,13 @@ require (
4446
cloud.google.com/go/trace v1.2.0 // indirect
4547
github.com/GoogleCloudPlatform/opentelemetry-operations-go/internal/resourcemapping v0.32.3 // indirect
4648
github.com/KyleBanks/depth v1.2.1 // indirect
49+
github.com/Masterminds/semver v1.4.2 // indirect
50+
github.com/Masterminds/sprig v2.16.0+incompatible // indirect
51+
github.com/PuerkitoBio/goquery v1.5.0 // indirect
4752
github.com/VividCortex/ewma v1.1.1 // indirect
4853
github.com/andybalholm/brotli v1.0.4 // indirect
54+
github.com/andybalholm/cascadia v1.0.0 // indirect
55+
github.com/aokoli/goutils v1.0.1 // indirect
4956
github.com/fatih/color v1.10.0 // indirect
5057
github.com/go-logr/logr v1.2.3 // indirect
5158
github.com/go-logr/stdr v1.2.2 // indirect
@@ -60,6 +67,9 @@ require (
6067
github.com/googleapis/enterprise-certificate-proxy v0.1.0 // indirect
6168
github.com/googleapis/gax-go/v2 v2.4.0 // indirect
6269
github.com/googleapis/go-type-adapters v1.0.0 // indirect
70+
github.com/gorilla/css v1.0.0 // indirect
71+
github.com/huandu/xstrings v1.2.0 // indirect
72+
github.com/imdario/mergo v0.3.6 // indirect
6373
github.com/jackc/chunkreader/v2 v2.0.1 // indirect
6474
github.com/jackc/pgconn v1.12.1 // indirect
6575
github.com/jackc/pgio v1.0.0 // indirect
@@ -68,6 +78,7 @@ require (
6878
github.com/jackc/pgservicefile v0.0.0-20200714003250-2b9c44734f2b // indirect
6979
github.com/jackc/pgtype v1.11.0 // indirect
7080
github.com/jackc/pgx/v4 v4.16.1 // indirect
81+
github.com/jaytaylor/html2text v0.0.0-20180606194806-57d518f124b0 // indirect
7182
github.com/jinzhu/inflection v1.0.0 // indirect
7283
github.com/jinzhu/now v1.1.4 // indirect
7384
github.com/josharian/intern v1.0.0 // indirect
@@ -79,11 +90,17 @@ require (
7990
github.com/mattn/go-runewidth v0.0.12 // indirect
8091
github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421 // indirect
8192
github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742 // indirect
93+
github.com/olekukonko/tablewriter v0.0.1 // indirect
8294
github.com/rivo/uniseg v0.2.0 // indirect
95+
github.com/russross/blackfriday/v2 v2.0.1 // indirect
96+
github.com/shurcooL/sanitized_anchor_name v1.0.0 // indirect
97+
github.com/ssor/bom v0.0.0-20170718123548-6386211fdfcf // indirect
8398
github.com/swaggo/files v0.0.0-20210815190702-a29dd2bc99b2 // indirect
8499
github.com/valyala/bytebufferpool v1.0.0 // indirect
85100
github.com/valyala/fasthttp v1.37.0 // indirect
86101
github.com/valyala/tcplisten v1.0.0 // indirect
102+
github.com/vanng822/css v0.0.0-20190504095207-a21e860bcd04 // indirect
103+
github.com/vanng822/go-premailer v0.0.0-20191214114701-be27abe028fe // indirect
87104
go.opencensus.io v0.23.0 // indirect
88105
go.uber.org/atomic v1.7.0 // indirect
89106
go.uber.org/multierr v1.8.0 // indirect

api/go.sum

Lines changed: 40 additions & 0 deletions
Large diffs are not rendered by default.

api/pkg/emails/hermes_mailer.go

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
package emails
2+
3+
import (
4+
"fmt"
5+
"strconv"
6+
"time"
7+
8+
"github.com/matcornic/hermes/v2"
9+
)
10+
11+
// HermesGeneratorConfig contains details for the generator
12+
type HermesGeneratorConfig struct {
13+
AppURL string
14+
AppName string
15+
AppLogoURL string
16+
}
17+
18+
// Generator creates hermes.Hermes from HermesGeneratorConfig
19+
func (config *HermesGeneratorConfig) Generator() hermes.Hermes {
20+
return hermes.Hermes{
21+
Theme: newHermesTheme(),
22+
Product: hermes.Product{
23+
// Appears in header & footer of e-mails
24+
Name: fmt.Sprintf("The %s Team", config.AppName),
25+
Link: config.AppURL,
26+
// Optional product logo
27+
Copyright: fmt.Sprintf("© %s %s. All rights reserved.", strconv.Itoa(time.Now().Year()), config.AppName),
28+
Logo: config.AppLogoURL,
29+
},
30+
}
31+
}

0 commit comments

Comments
 (0)