Skip to content

Commit

Permalink
chore(merge): conflict 해결
Browse files Browse the repository at this point in the history
  • Loading branch information
jacobhboy committed Apr 23, 2024
2 parents a310daa + 95df7d9 commit e95a468
Show file tree
Hide file tree
Showing 5 changed files with 87 additions and 87 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,18 +28,38 @@ public void sendMail(CoffeeChat coffeeChat) {
MimeMessage message = mailSender.createMimeMessage();

try {
message.addRecipients(TO, coffeeChat.getToUser().getEmail());
message.setSubject("안녕하세요. 식견입니다.");
setRecipientsAndFrom(coffeeChat, message);
message.setSubject(setSubjectWithCoffeeChat(coffeeChat));
message.setText(setContext(coffeeChat), "utf-8", "html");

message.setFrom(coffeeChat.getFromUser().getEmail());
} catch (MessagingException e) {
throw new EmailNotExistException();
}

mailSender.send(message);
}

private void setRecipientsAndFrom(CoffeeChat coffeeChat, MimeMessage message) throws MessagingException {
if (coffeeChat.getState().equals(State.PENDING)) {
message.addRecipients(TO, coffeeChat.getToUser().getEmail());
message.setFrom(coffeeChat.getFromUser().getEmail());
} else {
message.addRecipients(TO, coffeeChat.getFromUser().getEmail());
message.setFrom(coffeeChat.getToUser().getEmail());
}
}

private String setSubjectWithCoffeeChat(CoffeeChat coffeeChat) {
String fromUserName = coffeeChat.getFromUser().getName();
String toUserName = coffeeChat.getToUser().getName();

if (coffeeChat.getState().equals(State.ACCEPT)) {
return toUserName + "님께서 " + fromUserName + "님의 커피챗 요청을 수락하셨어요.";
} else if (coffeeChat.getState().equals(State.REJECT)) {
return toUserName + "님께서 " + fromUserName + "님의 커피챗 요청을 거절하셨어요...ㅠ";
}
return fromUserName + "님으로부터 커피챗 요청이 왔어요.";
}

private String setContext(CoffeeChat coffeeChat) {
Context context = new Context();
context.setVariable("fromuser", coffeeChat.getFromUser().getName());
Expand Down
35 changes: 19 additions & 16 deletions main-server/src/main/resources/templates/accept-mail.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,30 +5,33 @@
<title>Send Mail</title>
</head>
<body>
<div class="back">
<div class="content">
<div class="back" style="width: 480px; height: 480px;">
<div style="width: 100%;">
<img src="https://sickgyun.s3.ap-northeast-2.amazonaws.com/file1317437e-d407-4cd6-be35-0e45ed8c1b2b"
class="logo" style="width: 110px;" alt="logo">
<h2 class="coffeeChat" style="margin-top: 20px; color: black;">
<span th:text="${fromuser}"></span>님께서<br>
커피챗 요청을 수락하셨습니다.
style="display: block; width: 141px; height: 48px; margin: 0 auto;" alt="Logo">
<h2 style="font-size: 24px; font-weight: 700; text-align: center; margin-top: 40px; margin-bottom: 35px;">
<span th:text="${touser}"></span>님이 커피챗 요청을 수락했어요.<br>
</h2>
</div>
</div>
<a href="https://sickgyun.vercel.app/" style="text-decoration-line: none;">
<div class="coffeeChatButton" style="
<a href="https://sickgyun.com/email" style="text-decoration-line: none;">
<div class="coffeeChatButton" style="
display: flex;
align-items: center;
justify-content: center;
margin-top: 20px;
background-color: #7046f7;
width: 287px;
height: 45px;
width: 100%;
height: 54px;
border-radius: 8px;
color: white;
cursor: pointer;
font-size: 16px;
text-align: center;
line-height: 45px;
font-weight: 500;
line-height: 130%;
">
식견 바로가기
</div>
</a>
식견에서 확인하기
</div>
</a>
</div>
</body>
</html>
38 changes: 22 additions & 16 deletions main-server/src/main/resources/templates/application-mail.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,30 +5,36 @@
<title>Send Mail</title>
</head>
<body>
<div class="back">
<div class="content">
<div class="back" style="width: 480px; height: 480px;">
<div>
<img src="https://sickgyun.s3.ap-northeast-2.amazonaws.com/file1317437e-d407-4cd6-be35-0e45ed8c1b2b"
class="logo" style="width: 110px;" alt="logo">
<h2 class="coffeeChat" style="margin-top: 20px; color: black;">
<span th:text="${fromuser}"></span>님으로부터<br>
커피챗 요청이 왔습니다.
style="display: block; width: 141px; height: 48px; margin: 0 auto;" alt="Logo">
<h2 style="font-size: 24px; font-weight: 700; text-align: center; margin-top: 40px;">
<span th:text="${fromuser}"></span>님이 커피챗 요청을 보냈어요.<br>
</h2>
<div style="width: 440px; max-height: 180px; min-height: 100px; border-radius: 8px; background-color: #FBFBFC; text-align: left; padding: 20px; margin-bottom: 20px; overflow: scroll;">
<span th:text="${message}"></span> <br>
</div>
</div>
</div>
<a href="https://sickgyun.vercel.app/" style="text-decoration-line: none;">
<div class="coffeeChatButton" style="
<a href="https://sickgyun.com/email" style="text-decoration-line: none;">
<div class="coffeeChatButton" style="
display: flex;
align-items: center;
justify-content: center;
margin-top: 20px;
background-color: #7046f7;
width: 287px;
height: 45px;
width: 100%;
height: 54px;
border-radius: 8px;
color: white;
cursor: pointer;
font-size: 16px;
text-align: center;
line-height: 45px;
font-weight: 500;
line-height: 130%;
">
식견 바로가기
</div>
</a>
식견에서 확인하기
</div>
</a>
</div>
</body>
</html>
34 changes: 0 additions & 34 deletions main-server/src/main/resources/templates/cancelled-mail.html

This file was deleted.

39 changes: 22 additions & 17 deletions main-server/src/main/resources/templates/reject-mail.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,31 +5,36 @@
<title>Send Mail</title>
</head>
<body>
<div class="back">
<div class="content">
<div class="back" style="width: 480px; height: 480px;">
<div>
<img src="https://sickgyun.s3.ap-northeast-2.amazonaws.com/file1317437e-d407-4cd6-be35-0e45ed8c1b2b"
class="logo" style="width: 110px;" alt="logo">
<h2 class="coffeeChat" style="margin-top: 20px; color: black;">
<span th:text="${fromuser}"></span>님께서<br>
"<span th:text="${message}"></span>" <br>
다음의 이유로 커피챗 요청을 거절하였습니다.
style="display: block; width: 141px; height: 48px; margin: 0 auto;" alt="Logo">
<h2 style="font-size: 24px; font-weight: 700; text-align: center; margin-top: 40px;">
<span th:text="${touser}"></span>님이 커피챗 요청을 거절했어요.<br>
</h2>
<div style="width: 440px; max-height: 180px; min-height: 100px; border-radius: 8px; background-color: #FBFBFC; text-align: left; padding: 20px; margin-bottom: 20px; overflow: scroll;">
<span th:text="${message}"></span> <br>
</div>
</div>
</div>
<a href="https://sickgyun.vercel.app/" style="text-decoration-line: none;">
<div class="coffeeChatButton" style="
<a href="https://sickgyun.com/email" style="text-decoration-line: none;">
<div class="coffeeChatButton" style="
display: flex;
align-items: center;
justify-content: center;
margin-top: 20px;
background-color: #7046f7;
width: 287px;
height: 45px;
width: 100%;
height: 54px;
border-radius: 8px;
color: white;
cursor: pointer;
font-size: 16px;
text-align: center;
line-height: 45px;
font-weight: 500;
line-height: 130%;
">
식견 바로가기
</div>
</a>
식견에서 확인하기
</div>
</a>
</div>
</body>
</html>

0 comments on commit e95a468

Please sign in to comment.