respected company in mails.

This commit is contained in:
$(pass /github/name)
2024-07-16 19:15:06 +02:00
parent eeeabd5ad3
commit 9eef7f7681
3 changed files with 10 additions and 3 deletions

View File

@@ -79,12 +79,14 @@ func (s *EmailService) SendVerificationEmail(user *models.User, token *string) e
func (s *EmailService) SendWelcomeEmail(user *models.User) error { func (s *EmailService) SendWelcomeEmail(user *models.User) error {
// Prepare data to be injected into the template // Prepare data to be injected into the template
data := struct { data := struct {
Company string
FirstName string FirstName string
MembershipModel string MembershipModel string
MembershipID int64 MembershipID int64
MembershipFee float32 MembershipFee float32
RentalFee float32 RentalFee float32
}{ }{
Company: *user.Company,
FirstName: user.FirstName, FirstName: user.FirstName,
MembershipModel: user.Membership.SubscriptionModel.Name, MembershipModel: user.Membership.SubscriptionModel.Name,
MembershipID: user.Membership.ID, MembershipID: user.Membership.ID,
@@ -104,6 +106,7 @@ func (s *EmailService) SendWelcomeEmail(user *models.User) error {
func (s *EmailService) NotifyAdminOfNewUser(user *models.User) error { func (s *EmailService) NotifyAdminOfNewUser(user *models.User) error {
// Prepare data to be injected into the template // Prepare data to be injected into the template
data := struct { data := struct {
Company string
FirstName string FirstName string
LastName string LastName string
MembershipModel string MembershipModel string
@@ -118,6 +121,7 @@ func (s *EmailService) NotifyAdminOfNewUser(user *models.User) error {
Phone string Phone string
IBAN string IBAN string
}{ }{
Company: *user.Company,
FirstName: user.FirstName, FirstName: user.FirstName,
LastName: user.LastName, LastName: user.LastName,
MembershipModel: user.Membership.SubscriptionModel.Name, MembershipModel: user.Membership.SubscriptionModel.Name,

View File

@@ -76,6 +76,9 @@
<li><strong>Preis/h</strong>: {{.RentalFee}}</li> <li><strong>Preis/h</strong>: {{.RentalFee}}</li>
</ul> </ul>
</li> </li>
{{if .Company}}
<li><strong>Firma:</strong> {{.Company}}</li>
{{end}}
<li><strong>Name:</strong> {{.FirstName}} {{.LastName}}</li> <li><strong>Name:</strong> {{.FirstName}} {{.LastName}}</li>
<li><strong>Mitgliedsnr:</strong> {{.MembershipID}}</li> <li><strong>Mitgliedsnr:</strong> {{.MembershipID}}</li>
<li> <li>

View File

@@ -31,11 +31,11 @@
<td> <td>
<div style="padding: 24px 24px 24px 24px"> <div style="padding: 24px 24px 24px 24px">
<a <a
href="https://marketbase.app" href="https://carsharing-hasloh.de"
style="text-decoration: none" style="text-decoration: none"
target="_blank" target="_blank"
><img ><img
alt="Marketbase" alt="Carsharing Hasloh"
src="https://carsharing-hasloh.de/images/CarsharingSH-Hasloh-LOGO.jpeg" src="https://carsharing-hasloh.de/images/CarsharingSH-Hasloh-LOGO.jpeg"
style=" style="
outline: none; outline: none;
@@ -48,7 +48,7 @@
/></a> /></a>
</div> </div>
<div style="font-weight: normal; padding: 0px 24px 16px 24px"> <div style="font-weight: normal; padding: 0px 24px 16px 24px">
Moin {{.FirstName}} 👋, Moin {{.FirstName}} {{if .Company}}({{.Company}}){{end}}👋,
</div> </div>
<div style="font-weight: normal; padding: 0px 24px 16px 24px"> <div style="font-weight: normal; padding: 0px 24px 16px 24px">
wir freuen uns sehr, dich als neues Mitglied bei Carsharing wir freuen uns sehr, dich als neues Mitglied bei Carsharing