From 4328dcd336bf654c231af79c427b4c5e953a325e Mon Sep 17 00:00:00 2001 From: Thunder Date: Mon, 18 Mar 2024 17:35:36 +0700 Subject: [PATCH] Fix content and title in send email --- .../controller/management/order/AddOrderServlet.java | 2 +- .../controller/others/login/ForgotPasswordServlet.java | 2 +- .../io/hardingadonis/saledock/utils/SendEmailUtil.java | 8 ++++---- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/main/java/io/hardingadonis/saledock/controller/management/order/AddOrderServlet.java b/src/main/java/io/hardingadonis/saledock/controller/management/order/AddOrderServlet.java index 51bccc9..0c03a89 100644 --- a/src/main/java/io/hardingadonis/saledock/controller/management/order/AddOrderServlet.java +++ b/src/main/java/io/hardingadonis/saledock/controller/management/order/AddOrderServlet.java @@ -103,7 +103,7 @@ protected void doPost(HttpServletRequest request, HttpServletResponse response) } } Order saveOrder = Singleton.orderDAO.save(order); - SendEmailUtil.sendOrderMessage(customer.get().getEmail(), "Slae Dock - Đặt hàng thành công", saveOrder); + SendEmailUtil.sendOrderMessage(customer.get().getEmail(), "Sale Dock - Đặt hàng thành công", saveOrder); SessionUtil.getInstance().removeValue(request, "productMap"); response.sendRedirect("./order?message=orderSuccess"); } else { diff --git a/src/main/java/io/hardingadonis/saledock/controller/others/login/ForgotPasswordServlet.java b/src/main/java/io/hardingadonis/saledock/controller/others/login/ForgotPasswordServlet.java index 72a19aa..8b2d91c 100644 --- a/src/main/java/io/hardingadonis/saledock/controller/others/login/ForgotPasswordServlet.java +++ b/src/main/java/io/hardingadonis/saledock/controller/others/login/ForgotPasswordServlet.java @@ -44,7 +44,7 @@ private void checkEmail(HttpServletRequest request, HttpServletResponse response if (employee.isPresent()) { request.setAttribute("message", "success"); String newOtp = OtpUtil.generateRandomOTP(); - SendEmailUtil.sendGetOTPMessage(email, "New OTP", newOtp); + SendEmailUtil.sendGetOTPMessage(email, "Sale Dock - Quên mật khẩu?", newOtp); SessionUtil.getInstance().putValue(request, "otp", newOtp); SessionUtil.getInstance().putValue(request, "email", email); request.getRequestDispatcher("/view/jsp/others/login/otp.jsp").forward(request, response); diff --git a/src/main/java/io/hardingadonis/saledock/utils/SendEmailUtil.java b/src/main/java/io/hardingadonis/saledock/utils/SendEmailUtil.java index 195f7ed..6fa9371 100644 --- a/src/main/java/io/hardingadonis/saledock/utils/SendEmailUtil.java +++ b/src/main/java/io/hardingadonis/saledock/utils/SendEmailUtil.java @@ -73,12 +73,12 @@ public static void sendGetOTPMessage(String to, String title, String otp) { + "\n" + " \n" + " \n" - + " Get OTP\n" + + " Lấy mã OTP\n" + "\n" + "\n" - + "

Welcome to Sale Dock

\n" - + "

Your OTP to change your account password is: " + otp + "

\n" - + "

Please usse this OTP to change your old password.

\n" + + "

Chào mừng đến với Sale Dock

\n" + + "

Mã OTP của bạn là: " + otp + "

\n" + + "

Vui lòng sử dụng mã trên để thực hiện quá trình thay đổi mật khẩu.

\n" + " \n" + "\n" + "";