add: plaintext email; improved templating
This commit is contained in:
@@ -74,7 +74,7 @@ func (s *EmailService) SendVerificationEmail(user *models.User, token *string) e
|
||||
}
|
||||
|
||||
subject := constants.MailVerificationSubject
|
||||
body, err := ParseTemplate("mail_verification.html", data)
|
||||
body, err := ParseTemplate("mail_verification.tmpl", data)
|
||||
if err != nil {
|
||||
logger.Error.Print("Couldn't send verification mail")
|
||||
return err
|
||||
@@ -92,6 +92,8 @@ func (s *EmailService) SendWelcomeEmail(user *models.User) error {
|
||||
BASEURL string
|
||||
MembershipID int64
|
||||
MembershipFee float32
|
||||
Logo string
|
||||
WebsiteTitle string
|
||||
RentalFee float32
|
||||
}{
|
||||
Company: user.Company,
|
||||
@@ -101,10 +103,12 @@ func (s *EmailService) SendWelcomeEmail(user *models.User) error {
|
||||
MembershipFee: float32(user.Membership.SubscriptionModel.MonthlyFee),
|
||||
RentalFee: float32(user.Membership.SubscriptionModel.HourlyRate),
|
||||
BASEURL: config.BaseURL,
|
||||
WebsiteTitle: config.WebsiteTitle,
|
||||
Logo: config.Templates.LogoURI,
|
||||
}
|
||||
|
||||
subject := constants.MailWelcomeSubject
|
||||
body, err := ParseTemplate("mail_welcome.html", data)
|
||||
body, err := ParseTemplate("mail_welcome.tmpl", data)
|
||||
if err != nil {
|
||||
logger.Error.Print("Couldn't send welcome mail")
|
||||
return err
|
||||
@@ -130,6 +134,8 @@ func (s *EmailService) SendRegistrationNotification(user *models.User) error {
|
||||
MembershipID int64
|
||||
RentalFee float32
|
||||
MembershipFee float32
|
||||
Logo string
|
||||
WebsiteTitle string
|
||||
}{
|
||||
Company: user.Company,
|
||||
FirstName: user.FirstName,
|
||||
@@ -146,10 +152,12 @@ func (s *EmailService) SendRegistrationNotification(user *models.User) error {
|
||||
Phone: user.Phone,
|
||||
IBAN: user.BankAccount.IBAN,
|
||||
BASEURL: config.BaseURL,
|
||||
Logo: config.Templates.LogoURI,
|
||||
WebsiteTitle: config.WebsiteTitle,
|
||||
}
|
||||
|
||||
subject := constants.MailRegistrationSubject
|
||||
body, err := ParseTemplate("mail_registration.html", data)
|
||||
body, err := ParseTemplate("mail_registration.tmpl", data)
|
||||
if err != nil {
|
||||
logger.Error.Print("Couldn't send admin notification mail")
|
||||
return err
|
||||
@@ -159,16 +167,20 @@ func (s *EmailService) SendRegistrationNotification(user *models.User) error {
|
||||
|
||||
func (s *EmailService) RelayContactFormMessage(sender string, name string, message string) error {
|
||||
data := struct {
|
||||
Message string
|
||||
Name string
|
||||
BASEURL string
|
||||
Message string
|
||||
Name string
|
||||
BASEURL string
|
||||
Logo string
|
||||
WebsiteTitle string
|
||||
}{
|
||||
Message: message,
|
||||
Name: name,
|
||||
BASEURL: config.BaseURL,
|
||||
Message: message,
|
||||
Name: name,
|
||||
BASEURL: config.BaseURL,
|
||||
Logo: config.Templates.LogoURI,
|
||||
WebsiteTitle: config.WebsiteTitle,
|
||||
}
|
||||
subject := constants.MailContactSubject
|
||||
body, err := ParseTemplate("mail_contact_form.html", data)
|
||||
body, err := ParseTemplate("mail_contact_form.tmpl", data)
|
||||
if err != nil {
|
||||
logger.Error.Print("Couldn't send contact form message mail")
|
||||
return err
|
||||
|
||||
Reference in New Issue
Block a user