This commit is contained in:
aditya.siregar
2025-03-16 11:01:58 +08:00
parent c41826bb1b
commit 2554533e09
3 changed files with 107 additions and 117 deletions
@@ -235,7 +235,7 @@ func (s *memberSvc) sendWelcomeEmail(
welcomeData := map[string]interface{}{
"UserName": customer.Name,
"MemberID": customer.CustomerID,
"PointsName": "PoinLo",
"PointsName": "ELP",
"PointsBalance": customer.Points,
"RedeemLink": "https://enaklo.co.id/redeem",
"CurrentDate": time.Now().Format("01-20006"),
+6 -4
View File
@@ -51,7 +51,7 @@ func (s *orderSvc) processPostOrderActions(
}
if order.CustomerID != nil && *order.CustomerID > 0 {
err = s.addCustomerPoints(ctx, *order.CustomerID, int(order.Total))
err = s.addCustomerPoints(ctx, *order.CustomerID, int(order.Total/1000))
if err != nil {
logger.ContextLogger(ctx).Error("error when adding points", zap.Error(err))
}
@@ -136,8 +136,9 @@ func (s *orderSvc) sendTransactionReceipt(ctx mycontext.Context, order *entity.O
emailData := map[string]interface{}{
"UserName": customer.Name,
"PointsName": "PoinLo",
"PointsBalance": "20",
"PointsName": "ELP",
"PointsBalance": int(order.Total / 1000),
"NewPoints": int(order.Total / 1000),
"RedeemLink": "enaklo.co.id",
"BranchName": branchName,
"TransactionNumber": order.ID,
@@ -146,12 +147,13 @@ func (s *orderSvc) sendTransactionReceipt(ctx mycontext.Context, order *entity.O
"Items": itemsData,
"TotalPayment": fmt.Sprintf("Rp %s", formatCurrency(order.Total)),
"ViewTransactionLink": viewTransactionLink,
"ExpiryDate": order.CreatedAt.Format("02 January 2006"),
}
return s.notification.SendEmailTransactional(ctx, entity.SendEmailNotificationParam{
Sender: "noreply@enaklo.co.id",
Recipient: customer.Email,
Subject: "Enaklo - Membership Statement",
Subject: "Hore, kamu dapat poin!",
TemplateName: "monthly_points",
TemplatePath: "templates/monthly_points.html",
Data: emailData,