-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsecurity.go
More file actions
30 lines (26 loc) · 1.04 KB
/
security.go
File metadata and controls
30 lines (26 loc) · 1.04 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
package example
import (
"github.com/gzuidhof/myrtle"
"github.com/gzuidhof/myrtle/theme"
"github.com/gzuidhof/myrtle/theme/flat"
)
func SecurityCodeEmail() (*myrtle.Email, error) {
return SecurityCodeEmailWithTheme(flat.New())
}
func SecurityCodeEmailWithTheme(selectedTheme theme.Theme) (*myrtle.Email, error) {
if selectedTheme == nil {
selectedTheme = flat.New()
}
return myrtle.NewBuilder(
selectedTheme,
).
WithPreheader("Use this one-time code to sign in").
AddHeading("Your verification code").
WithHeader(commonHeaderGroup("Myrtle Security", selectedTheme)).
AddText("Use the code below to complete your sign-in. This code expires in 10 minutes.").
Add(myrtle.VerificationCodeBlock{Label: "Verification code", Value: "493817"}).
AddKeyValue("Request details", []myrtle.KeyValuePair{{Key: "IP", Value: "203.0.113.5"}, {Key: "Location", Value: "Amsterdam, NL"}}).
AddText("If you did not request this code, secure your account immediately.").
AddButton("Review account", "https://example.com/account/security").
Build(), nil
}