link-fix
This commit is contained in:
parent
0aa1c2532b
commit
d47b39bb1d
|
@ -23,7 +23,15 @@ func MailgunRest(to string, data map[string]interface{}, subject string, templat
|
||||||
mg := mailgun.NewMailgun(mailgunDomain, mailgunAPIKey)
|
mg := mailgun.NewMailgun(mailgunDomain, mailgunAPIKey)
|
||||||
m := mg.NewMessage(sender, subject, "", to)
|
m := mg.NewMessage(sender, subject, "", to)
|
||||||
m.SetTemplate(template)
|
m.SetTemplate(template)
|
||||||
m.AddTemplateVariable("validation_url", data["validation_url"])
|
m.AddTemplateVariable("verification_url", data["verification_url"])
|
||||||
|
userMap, ok := data["user"].(map[string]interface{})
|
||||||
|
if !ok {
|
||||||
|
log.Println("Error: Unable to retrieve user information from the data map.")
|
||||||
|
}
|
||||||
|
userName, ok := userMap["GivenName"].(string)
|
||||||
|
if ok {
|
||||||
|
m.AddTemplateVariable("username", userName)
|
||||||
|
}
|
||||||
|
|
||||||
ctx, cancel := context.WithTimeout(context.Background(), time.Second*30)
|
ctx, cancel := context.WithTimeout(context.Background(), time.Second*30)
|
||||||
defer cancel()
|
defer cancel()
|
||||||
|
|
Loading…
Reference in New Issue
Block a user