Skip to content

Commit

Permalink
stag 최신화 (#139)
Browse files Browse the repository at this point in the history
* fix : 어드민 해커톤 신청 api response 트랜잭션 외부에서 동작해서 part 못불러오는 이슈 해결 (#134)

* feat: 해커톤 신청 시 이메일 전송 (#138)

---------

Co-authored-by: Donghun Shin <[email protected]>
  • Loading branch information
seulgi99 and shin-mallang authored Jul 2, 2024
1 parent 502b017 commit 6ddcc69
Show file tree
Hide file tree
Showing 2 changed files with 61 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -1,13 +1,17 @@
package likelion.univ.hackathon.controller;

import static likelion.univ.email.ContentsType.HTML;

import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import java.util.List;
import javax.validation.Valid;
import likelion.univ.domain.hackathon.response.HackathonFindResponse;
import likelion.univ.domain.hackathon.response.HackathonFormFindResponse;
import likelion.univ.domain.hackathon.service.HackathonService;
import likelion.univ.email.sender.EmailContent;
import likelion.univ.email.sender.EmailSender;
import likelion.univ.hackathon.email.HackathonApplyEmailContent;
import likelion.univ.hackathon.request.HackathonApplyRequest;
import likelion.univ.hackathon.request.HackathonModifyRequest;
import likelion.univ.response.SuccessResponse;
Expand Down Expand Up @@ -38,7 +42,12 @@ public SuccessResponse<Long> apply(
) {
Long userId = userUtils.getCurrentUserId();
Long projectId = hackathonService.apply(request.toCommand(userId));
// TODO: emailSender.send(); ???
emailSender.send(EmailContent.builder()
.subject("[멋쟁이사자처럼] 12기 중앙 해커톤 신청이 완료되었습니다.")
.contentsType(HTML.name())
.contents(HackathonApplyEmailContent.VALUE)
.receivers(List.of(request.email()))
.build());
return SuccessResponse.of(projectId);
}

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
package likelion.univ.hackathon.email;

public final class HackathonApplyEmailContent {

public static String VALUE = """
<!DOCTYPE html>
<html lang="en"><head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
</head>
<body style="overscroll-behavior-x: auto;">
<table align="center" style="width: 596px; table-layout: fixed; max-width: 596px" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td style="width: 20px"></td>
<td>
<img src="img.png" width="300" height="100" alt="" style="max-width: 100%; height: auto; vertical-align: top">
</td>
</tr>
<tr>
<td style="width: 20px"></td>
<td style="
padding: 20px 0;
border-radius: 7px;
font-weight: 500;
font-size: 20px;
color: #ffffff;
text-align: center;
background-color: #ff7710;
">
<a href="https://likelion.university/" style="
padding: 20px 62px;
border-radius: 7px;
text-decoration: none;
color: #ffffff;
">
홈페이지로 이동하기
</a>
</td>
<td style="width: 20px"></td>
</tr>
</tbody>
</table>
</body></html>
""";
}

0 comments on commit 6ddcc69

Please sign in to comment.