// SendActivationEmail allows to send an email to user to activate his account
SendActivationEmail allows to send an email to user to activate his account
// SendActivationEmail allows to send an email to user to activate his account
func (s *EmailSenderParams) SendActivationEmail(user *models.User, apiURL string, appName string, frontURL string) error {
	currentYear := strconv.Itoa(time.Now().Year())
	h := hermes.Hermes{
		Theme: new(hermes.Flat),
		Product: hermes.Product{ 
			Name: appName,
			Link: frontURL,
			Copyright: `Copyright © ` + currentYear + ` ` + appName + `. All rights reserved.`,
		},
	}
	email := hermes.Email{
		Body: hermes.Body{
			Name: user.FirstName + ` ` + user.LastName,
			Intros: []string{
				`Welcome to ` + appName + `! We're very excited to have you on board.`,
			},
			Dictionary: []hermes.Entry{
				{Key: "Email", Value: user.Email},
				{Key: "FirstName", Value: user.FirstName},
				{Key: "LastName", Value: user.LastName},
				{Key: "Phone", Value: user.Phone},
			},
			Actions: []hermes.Action{
				{
					Instructions: `To get started with ` + appName + `, please click here:`,
					Button: hermes.Button{
						Color:     `#22BC66`,
						TextColor: `#FFFFFF`,
						Text:      "Confirm your account",
						Link:      apiURL,
					},
				},
			},
			Outros: []string{
				`If you received this mail and it was not intended to you, please ignore it.`,
			},
		},
	}
	emailBody, err := h.GenerateHTML(email)
	if err != nil {
		logrus.Warnln(err)
		panic(err)
	}
	data := models.EmailData{ReceiverMail: user.Email, ReceiverName: user.FirstName + " " + user.LastName, User: user, Subject: `Welcome to ` + appName + `! We're very excited to have you on board.`, AppName: appName}
	return s.SendEmail(emailBody, &data)
}
func ( s * EmailSenderParams ) SendActivationEmail ( user * models . User , apiURL string , appName string , frontURL string ) error { currentYear := strconv . Itoa ( time . Now ( ) . Year ( ) ) h := hermes . Hermes { Theme : new ( hermes . Flat ) , Product : hermes . Product { Name : appName , Link : frontURL , Copyright : `Copyright © `  urrentYear   `  ppName  . All rights reserved.`, } , } email := hermes . Email { Body : hermes . Body { Name : user . FirstName + ` ` + user . LastName , Intros : [ ] string { `Welcome to ` + appName + `! We're very excited to have you on board.` , } , Dictionary : [ ] hermes . Entry { { Key : " " , Value : user . Email } , { Key : " " , Value : user . FirstName } , { Key : " " , Value : user . LastName } , { Key : " " , Value : user . Phone } , } , Actions : [ ] hermes . Action { { Instructions : `To get started with ` + appName + `, please click here:` , Button : hermes . Button { Color : `#22BC66` , TextColor : `#FFFFFF` , Text : " " , Link : apiURL , } , } , } , Outros : [ ] string { `If you received this mail and it was not intended to you, please ignore it.` , } , } , } emailBody , err := h . GenerateHTML ( email ) if err != nil { logrus . Warnln ( err ) panic ( err ) } data := models . EmailData { ReceiverMail : user . Email , ReceiverName : user . FirstName + " " + user . LastName , User : user , Subject : `Welcome to ` + appName + `! We're very excited to have you on board.` , AppName : appName } return s . SendEmail ( emailBody , & data ) }
SendActivationEmail allows to send an email to user to activate his account
SendActivationEmail allows to send an email to user to activate his account
// Appears in header & footer of e-mails //Logo: ``,