-
-
Notifications
You must be signed in to change notification settings - Fork 112
/
emails.go
46 lines (41 loc) · 1.43 KB
/
emails.go
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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
package user
import (
"fmt"
"github.com/azukaar/cosmos-server/src/utils"
)
func SendInviteEmail(nickname string, email string, link string) error {
return utils.SendEmail(
[]string{email},
"Cosmos Invitation for " + nickname,
fmt.Sprintf(`<h1>You have been invited!</h1>
Hello %s, <br>
The admin of a Cosmos Server invited you to join their server. <br>
In order to join, you can click the following link to setup your account: <br>
<a class="button" href="%s">Setup</a> <br><br>
See you soon!! <br>
`, nickname, link))
}
func SendAdminPasswordEmail(nickname string, email string, link string) error {
return utils.SendEmail(
[]string{email},
"Cosmos Password Reset",
fmt.Sprintf(`<h1>Password Reset</h1>
Hello %s, <br>
The admin of a Cosmos Server has sent you a password reset link. <br>
In order to reset your password, you can click the following link and fill in the form: <br>
<a class="button" href="%s">Reset Password</a> <br><br>
See you soon!! <br>
`, nickname, link))
}
func SendPasswordEmail(nickname string, email string, link string) error {
return utils.SendEmail(
[]string{email},
"Cosmos Password Reset",
fmt.Sprintf(`<h1>Password Reset</h1>
Hello %s, <br>
You have requested a password reset. If it wasn't you, please alert your server admin. <br>
If it was you, you can click the following link and fill in the form: <br>
<a class="button" href="%s">Reset Password</a> <br><br>
See you soon!! <br>
`, nickname, link))
}