diff --git a/internal/customer/service.go b/internal/customer/service.go index 910aa97..02966b6 100644 --- a/internal/customer/service.go +++ b/internal/customer/service.go @@ -145,7 +145,7 @@ func (s *customerService) Register(ctx context.Context, form *CreateCustomerForm "company_ids": Companies, }) - go s.notification.SendEmail(ctx, notification.Model{ + s.notification.SendEmail(ctx, notification.Model{ Recipient: customer.Email, Title: "Welcome to Opplens", Message: fmt.Sprintf("Welcome to Opplens\nUsername: %s\nPassword: %s", customer.Username, form.Password), @@ -412,7 +412,7 @@ func (s *customerService) UpdateStatus(ctx context.Context, id string, form *Upd "status": form.Status, }) - go s.notification.SendEmail(ctx, notification.Model{ + s.notification.SendEmail(ctx, notification.Model{ Recipient: customer.Email, Title: "Account Status Updated", Message: fmt.Sprintf("Your account has been %s", strings.ToUpper(form.Status)), @@ -858,7 +858,7 @@ func (s *customerService) RequestResetPassword(ctx context.Context, form *Reques } // Send OTP via email - go s.notification.SendEmail(ctx, notification.Model{ + s.notification.SendEmail(ctx, notification.Model{ Recipient: form.Email, Title: "Password Reset", Message: fmt.Sprintf("Your password reset code is: %s", otpCode), @@ -1053,7 +1053,7 @@ func (s *customerService) ResetPassword(ctx context.Context, form *ResetPassword "customer_id": customer.ID, }) - go s.notification.SendEmail(ctx, notification.Model{ + s.notification.SendEmail(ctx, notification.Model{ Recipient: tokenData.Email, Title: "Password Reset Success", Message: "Your password has been reset successfully", diff --git a/internal/user/service.go b/internal/user/service.go index 722321e..bfb9839 100644 --- a/internal/user/service.go +++ b/internal/user/service.go @@ -118,7 +118,7 @@ func (s *userService) Register(ctx context.Context, form *CreateUserForm) (*User "role": user.Role, }) - go s.notification.SendEmail(ctx, notification.Model{ + s.notification.SendEmail(ctx, notification.Model{ Recipient: form.Email, Title: "Welcome to Opplens", Message: fmt.Sprintf("Welcome to Opplens\nUsername: %s\nPassword: %s", form.Username, form.Password), @@ -229,7 +229,7 @@ func (s *userService) UpdateStatus(ctx context.Context, id string, form *UpdateU "status": form.Status, }) - go s.notification.SendEmail(ctx, notification.Model{ + s.notification.SendEmail(ctx, notification.Model{ Recipient: user.Email, Title: "Account Status Updated", Message: fmt.Sprintf("Your account has been %s", strings.ToUpper(form.Status)), @@ -488,7 +488,7 @@ func (s *userService) ChangePassword(ctx context.Context, userID string, form *C "user_id": userID, }) - go s.notification.SendEmail(ctx, notification.Model{ + s.notification.SendEmail(ctx, notification.Model{ Recipient: user.Email, Title: "Password Reset Success", Message: "Your password has been reset successfully",