Update
This commit is contained in:
parent
c41826bb1b
commit
2554533e09
@ -235,7 +235,7 @@ func (s *memberSvc) sendWelcomeEmail(
|
|||||||
welcomeData := map[string]interface{}{
|
welcomeData := map[string]interface{}{
|
||||||
"UserName": customer.Name,
|
"UserName": customer.Name,
|
||||||
"MemberID": customer.CustomerID,
|
"MemberID": customer.CustomerID,
|
||||||
"PointsName": "PoinLo",
|
"PointsName": "ELP",
|
||||||
"PointsBalance": customer.Points,
|
"PointsBalance": customer.Points,
|
||||||
"RedeemLink": "https://enaklo.co.id/redeem",
|
"RedeemLink": "https://enaklo.co.id/redeem",
|
||||||
"CurrentDate": time.Now().Format("01-20006"),
|
"CurrentDate": time.Now().Format("01-20006"),
|
||||||
|
|||||||
@ -51,7 +51,7 @@ func (s *orderSvc) processPostOrderActions(
|
|||||||
}
|
}
|
||||||
|
|
||||||
if order.CustomerID != nil && *order.CustomerID > 0 {
|
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 {
|
if err != nil {
|
||||||
logger.ContextLogger(ctx).Error("error when adding points", zap.Error(err))
|
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{}{
|
emailData := map[string]interface{}{
|
||||||
"UserName": customer.Name,
|
"UserName": customer.Name,
|
||||||
"PointsName": "PoinLo",
|
"PointsName": "ELP",
|
||||||
"PointsBalance": "20",
|
"PointsBalance": int(order.Total / 1000),
|
||||||
|
"NewPoints": int(order.Total / 1000),
|
||||||
"RedeemLink": "enaklo.co.id",
|
"RedeemLink": "enaklo.co.id",
|
||||||
"BranchName": branchName,
|
"BranchName": branchName,
|
||||||
"TransactionNumber": order.ID,
|
"TransactionNumber": order.ID,
|
||||||
@ -146,12 +147,13 @@ func (s *orderSvc) sendTransactionReceipt(ctx mycontext.Context, order *entity.O
|
|||||||
"Items": itemsData,
|
"Items": itemsData,
|
||||||
"TotalPayment": fmt.Sprintf("Rp %s", formatCurrency(order.Total)),
|
"TotalPayment": fmt.Sprintf("Rp %s", formatCurrency(order.Total)),
|
||||||
"ViewTransactionLink": viewTransactionLink,
|
"ViewTransactionLink": viewTransactionLink,
|
||||||
|
"ExpiryDate": order.CreatedAt.Format("02 January 2006"),
|
||||||
}
|
}
|
||||||
|
|
||||||
return s.notification.SendEmailTransactional(ctx, entity.SendEmailNotificationParam{
|
return s.notification.SendEmailTransactional(ctx, entity.SendEmailNotificationParam{
|
||||||
Sender: "noreply@enaklo.co.id",
|
Sender: "noreply@enaklo.co.id",
|
||||||
Recipient: customer.Email,
|
Recipient: customer.Email,
|
||||||
Subject: "Enaklo - Membership Statement",
|
Subject: "Hore, kamu dapat poin!",
|
||||||
TemplateName: "monthly_points",
|
TemplateName: "monthly_points",
|
||||||
TemplatePath: "templates/monthly_points.html",
|
TemplatePath: "templates/monthly_points.html",
|
||||||
Data: emailData,
|
Data: emailData,
|
||||||
|
|||||||
@ -1,8 +1,8 @@
|
|||||||
<!doctype html>
|
<!doctype html>
|
||||||
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office">
|
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||||
|
|
||||||
<head>
|
<head>
|
||||||
<title>Laporan Keanggotaan Anda</title>
|
<title>Points Notification</title>
|
||||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||||
@ -12,148 +12,136 @@
|
|||||||
padding: 0;
|
padding: 0;
|
||||||
-webkit-text-size-adjust: 100%;
|
-webkit-text-size-adjust: 100%;
|
||||||
-ms-text-size-adjust: 100%;
|
-ms-text-size-adjust: 100%;
|
||||||
background-color: #f1f0f7;
|
background-color: #f5f5f5;
|
||||||
}
|
font-family: Arial, sans-serif;
|
||||||
|
|
||||||
table,
|
|
||||||
td {
|
|
||||||
border-collapse: collapse;
|
|
||||||
mso-table-lspace: 0pt;
|
|
||||||
mso-table-rspace: 0pt;
|
|
||||||
}
|
|
||||||
|
|
||||||
img {
|
|
||||||
border: 0;
|
|
||||||
height: auto;
|
|
||||||
line-height: 100%;
|
|
||||||
outline: none;
|
|
||||||
text-decoration: none;
|
|
||||||
-ms-interpolation-mode: bicubic;
|
|
||||||
}
|
|
||||||
|
|
||||||
p {
|
|
||||||
display: block;
|
|
||||||
margin: 13px 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
.mj-column-per-100 {
|
|
||||||
width: 100% !important;
|
|
||||||
max-width: 100%;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.content {
|
.content {
|
||||||
background-color: #ffffff;
|
background-color: #ffffff;
|
||||||
margin: 0px auto;
|
margin: 0px auto;
|
||||||
max-width: 600px;
|
max-width: 600px;
|
||||||
padding: 20px;
|
padding: 0;
|
||||||
border-radius: 10px;
|
border-radius: 12px;
|
||||||
box-shadow: 0px 4px 8px rgba(0, 0, 0, 0.1);
|
box-shadow: 0px 2px 10px rgba(0, 0, 0, 0.1);
|
||||||
|
overflow: hidden;
|
||||||
}
|
}
|
||||||
|
|
||||||
.header {
|
.header {
|
||||||
font-family: Ubuntu, Helvetica, Arial, sans-serif;
|
background-color: #d90000;
|
||||||
font-size: 24px;
|
padding: 25px 30px;
|
||||||
line-height: 28px;
|
|
||||||
color: #f46f02;
|
|
||||||
text-align: center;
|
text-align: center;
|
||||||
margin-bottom: 20px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.title {
|
|
||||||
font-family: Ubuntu, Helvetica, Arial, sans-serif;
|
|
||||||
font-size: 20px;
|
|
||||||
line-height: 22px;
|
|
||||||
color: #000000;
|
|
||||||
text-align: center;
|
|
||||||
margin-bottom: 20px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.text {
|
|
||||||
font-family: Ubuntu, Helvetica, Arial, sans-serif;
|
|
||||||
font-size: 16px;
|
|
||||||
line-height: 22px;
|
|
||||||
color: #000000;
|
|
||||||
text-align: center;
|
|
||||||
margin-bottom: 20px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.points {
|
|
||||||
display: block;
|
|
||||||
width: fit-content;
|
|
||||||
margin: 20px auto;
|
|
||||||
background-color: #f5f5f5;
|
|
||||||
color: #000000;
|
|
||||||
text-align: center;
|
|
||||||
padding: 15px 25px;
|
|
||||||
border-radius: 5px;
|
|
||||||
font-family: Ubuntu, Helvetica, Arial, sans-serif;
|
|
||||||
font-size: 22px;
|
|
||||||
line-height: 24px;
|
|
||||||
font-weight: bold;
|
|
||||||
letter-spacing: 1px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.footer {
|
|
||||||
font-family: Ubuntu, Helvetica, Arial, sans-serif;
|
|
||||||
font-size: 12px;
|
|
||||||
line-height: 15px;
|
|
||||||
text-align: center;
|
|
||||||
color: #808080;
|
|
||||||
margin-top: 20px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.divider {
|
|
||||||
border-top: solid 1px #808080;
|
|
||||||
margin: 20px auto;
|
|
||||||
width: 100%;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.logo {
|
.logo {
|
||||||
display: block;
|
width: 120px;
|
||||||
margin: 0 auto 20px;
|
margin-bottom: 15px;
|
||||||
width: 150px;
|
}
|
||||||
|
|
||||||
|
.greeting {
|
||||||
|
color: white;
|
||||||
|
font-size: 22px;
|
||||||
|
font-weight: bold;
|
||||||
|
margin: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.body-content {
|
||||||
|
padding: 30px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.points-card {
|
||||||
|
background-color: #fff8f0;
|
||||||
|
border-radius: 10px;
|
||||||
|
padding: 20px;
|
||||||
|
margin-bottom: 25px;
|
||||||
|
border-left: 5px solid #f46f02;
|
||||||
|
}
|
||||||
|
|
||||||
|
.points-heading {
|
||||||
|
font-size: 16px;
|
||||||
|
color: #666;
|
||||||
|
margin: 0 0 5px 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.points-value {
|
||||||
|
font-weight: bold;
|
||||||
|
font-size: 28px;
|
||||||
|
color: #f46f02;
|
||||||
|
margin: 0 0 5px 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.expiry {
|
||||||
|
font-size: 14px;
|
||||||
|
color: #888;
|
||||||
|
margin: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.total-points-card {
|
||||||
|
background-color: #f5f5f5;
|
||||||
|
border-radius: 10px;
|
||||||
|
padding: 20px;
|
||||||
|
margin-bottom: 25px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.message {
|
||||||
|
font-size: 16px;
|
||||||
|
line-height: 1.5;
|
||||||
|
color: #333333;
|
||||||
|
margin-bottom: 25px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.cta-button {
|
.cta-button {
|
||||||
display: block;
|
display: block;
|
||||||
width: fit-content;
|
width: 100%;
|
||||||
margin: 20px auto;
|
padding: 15px 0;
|
||||||
padding: 12px 20px;
|
|
||||||
background-color: #d90000;
|
background-color: #d90000;
|
||||||
color: #ffffff !important;
|
color: #ffffff !important;
|
||||||
font-size: 16px;
|
font-size: 16px;
|
||||||
font-family: Ubuntu, Helvetica, Arial, sans-serif;
|
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
text-decoration: none;
|
text-decoration: none;
|
||||||
border-radius: 5px;
|
border-radius: 8px;
|
||||||
text-decoration: none !important;
|
}
|
||||||
|
|
||||||
|
.footer {
|
||||||
|
font-size: 12px;
|
||||||
|
line-height: 1.5;
|
||||||
|
text-align: center;
|
||||||
|
color: #808080;
|
||||||
|
margin-top: 30px;
|
||||||
|
padding-top: 20px;
|
||||||
|
border-top: 1px solid #eeeeee;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
<body>
|
<body>
|
||||||
<div style="padding: 50px; background-color: #f1f0f7;">
|
<div style="padding: 40px 20px; background-color: #f5f5f5;">
|
||||||
<div class="content">
|
<div class="content">
|
||||||
<img src="https://res.cloudinary.com/dl0wpumax/image/upload/c_thumb,w_200,g_face/v1741363977/61747686_5_vtz0n4.png" alt="Enaklo Logo" class="logo">
|
<div class="header">
|
||||||
<div class="title">Laporan Keanggotaan Anda</div>
|
<img src="https://res.cloudinary.com/dl0wpumax/image/upload/c_thumb,w_200,g_face/v1741363977/61747686_5_vtz0n4.png" alt="Enaklo Logo" class="logo">
|
||||||
<div class="text">
|
<h1 class="greeting">Hai {{ .UserName }}!</h1>
|
||||||
Hi {{ .UserName }},<br><br>
|
|
||||||
Berikut adalah laporan keanggotaan Anda untuk bulan ini. Saldo <b>{{ .PointsName }}</b> Anda saat ini adalah:
|
|
||||||
</div>
|
</div>
|
||||||
<div class="points">{{ .PointsBalance }} {{ .PointsName }}</div>
|
|
||||||
<div class="text">
|
<div class="body-content">
|
||||||
Gunakan {{ .PointsName }} Anda untuk menukarkan diskon spesial dan hadiah menarik! <br>
|
<div class="points-card">
|
||||||
Cek penawaran terbaru dan nikmati makanan favorit Anda.
|
<p class="points-heading">Kamu dapat poin</p>
|
||||||
</div>
|
<p class="points-value">{{ .NewPoints }} {{ .PointsName }}</p>
|
||||||
<a href="{{ .RedeemLink }}" class="cta-button">Tukarkan Sekarang</a>
|
<p class="expiry">Berlaku sampai {{ .ExpiryDate }}</p>
|
||||||
<div class="divider"></div>
|
</div>
|
||||||
<div class="footer">
|
|
||||||
Email ini dikirim secara otomatis. Mohon jangan membalas email ini. <br>
|
<div class="message">
|
||||||
Butuh bantuan? Hubungi tim support kami di <a href="mailto:support@enaklo.com">support@enaklo.com</a>.
|
Kamu bisa pakai poinnya untuk memotong jumlah transaksimu atau ditukarkan dengan Deals. Yuk, pakai sekarang!
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<a href="{{ .RedeemLink }}" class="cta-button">Pakai Sekarang</a>
|
||||||
|
|
||||||
|
<div class="footer">
|
||||||
|
Email ini dikirim secara otomatis. Mohon jangan membalas email ini.<br>
|
||||||
|
Butuh bantuan? Hubungi tim support kami di <a href="mailto:support@enaklo.com" style="color: #f46f02;">support@enaklo.com</a>.
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</body>
|
</body>
|
||||||
|
|
||||||
</html>
|
</html>
|
||||||
Loading…
x
Reference in New Issue
Block a user