-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #53 from studio-recoding/feat-email-send
[🚀feat] 이메일 전송 스케쥴링 구현(템플릿 수정 완료, 테스트 완료)
- Loading branch information
Showing
9 changed files
with
152 additions
and
45 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
25 changes: 0 additions & 25 deletions
25
src/main/java/Ness/Backend/domain/email/EmailController.java
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
30 changes: 30 additions & 0 deletions
30
src/main/java/Ness/Backend/domain/profile/email/EmailController.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
package Ness.Backend.domain.profile.email; | ||
|
||
import Ness.Backend.domain.member.entity.Member; | ||
import Ness.Backend.global.auth.AuthUser; | ||
import io.swagger.v3.oas.annotations.Operation; | ||
import lombok.RequiredArgsConstructor; | ||
import org.springframework.http.HttpStatusCode; | ||
import org.springframework.http.ResponseEntity; | ||
import org.springframework.web.bind.annotation.*; | ||
|
||
@RestController | ||
@RequiredArgsConstructor | ||
@RequestMapping("/email") | ||
public class EmailController { | ||
private final EmailService emailService; | ||
|
||
@PatchMapping("") | ||
@Operation(summary = "이메일 알림 기능 활성화/비활성화 API", description = "이메일 기능 활성화/비활성화를 맡는 API입니다.") | ||
public ResponseEntity<?> sendOverview(@AuthUser Member member, @RequestParam Boolean isActive){ | ||
emailService.setEmail(member.getId(), isActive); | ||
return new ResponseEntity<>(HttpStatusCode.valueOf(200)); | ||
} | ||
|
||
@PatchMapping("/test") | ||
@Operation(summary = "이메일 기능 테스트 API", description = "사용자가 어떤 이메일이 오는지 궁금할 때 테스트할 수 있는 API 입ㄴ디ㅏ.") | ||
public ResponseEntity<?> sendOverview(@AuthUser Member member){ | ||
emailService.sendEmailNotice(member.getEmail()); | ||
return new ResponseEntity<>(HttpStatusCode.valueOf(200)); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
<!DOCTYPE html> | ||
<html xmlns:th="http://www.thymeleaf.org"> | ||
<head> | ||
<meta charset="utf-8"> | ||
<link rel="stylesheet" as="style" crossorigin href="https://cdn.jsdelivr.net/gh/orioncactus/[email protected]/dist/web/variable/pretendardvariable.min.css" /> | ||
<style> | ||
body { | ||
font-family: "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont, system-ui, Roboto, "Helvetica Neue", "Segoe UI", "Apple SD Gothic Neo", "Noto Sans KR", "Malgun Gothic", "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", sans-serif; | ||
} | ||
</style> | ||
</head> | ||
<body> | ||
<div style="margin:0px; width:100%; background-color:#F2F0FF; padding:0px; padding-top:8px;"> | ||
<table style="width: 512px; align-content: center; position: relative; overflow: hidden; background: #fff; | ||
margin: 0px auto; max-width:512px; background-color:#ffffff; padding:0px"> | ||
<tr> | ||
<td style="height: 49px;"> | ||
<img | ||
src="https://ness-static-s3.s3.ap-northeast-2.amazonaws.com/ness_logo.png" | ||
style="width: 40px; height: 40px; vertical-align: middle;" | ||
/> | ||
<p style="font-size: 20px; font-weight: 700; text-align: left; color: #140f33; display: inline-block; vertical-align: middle; margin-left: 10px;" | ||
th:text="|${date}, 오늘 하루도 수고한 당신에게|"> | ||
오늘 하루도 수고한 당신에게 | ||
</p> | ||
</td> | ||
</tr> | ||
<!--구분선--> | ||
<tr> | ||
<td colspan="2" style="height: 1px; background-color: #3E426A; margin-bottom: 10px;"></td> | ||
</tr> | ||
<tr> | ||
<td colspan="2" style="text-align: center; padding-top: 15px; padding-left: 5px; padding-right: 5px;"> | ||
<img | ||
th:if="${image != null}" th:src="${image}" | ||
src="https://ness-static-s3.s3.ap-northeast-2.amazonaws.com/email_sample.png" | ||
style="object-fit: cover;" | ||
alt="email-image" | ||
/> | ||
</td> | ||
</tr> | ||
<tr> | ||
<td colspan="2" style="text-align: center;"> | ||
<p style="font-size: 16px; font-weight: 300; padding-left: 5px; padding-right: 5px; text-align: left; color: #140f33;"> | ||
<span>오늘 정말 수고 많았어요! 너무 고생했어요! 당신의 노력과 열정에 정말 감탄해요. 하루 종일 | ||
바쁘게 움직이면서도 절대 포기하지 않고 최선을 다하고 있는 모습이 정말 멋져요. 함께 있는 | ||
모든 순간이 너무 즐거워요! 이런 당신이 있어서 정말 행복해요. 앞으로도 함께 화이팅해요! | ||
함께 하는 모든 순간이 특별하고 의미있어요. 오늘도 정말 고마워요! 오늘도 정말 고맙습니다. | ||
함께한 하루가 뜻깊게 기억될 것입니다.</span><br /> | ||
<span>내일은 개발, 토익 공부하기 등의 활동이 있습니다. 이를 바탕으로 백엔드 공부를 더 | ||
공부하시는 건 어떨까요? 토익 공부도 체계적으로 진행해보시면 좋겠어요. 또한, 미리 발표 | ||
준비를 하는 것도 좋은 것 같아요. | ||
</span> | ||
</p> | ||
</td> | ||
</tr> | ||
|
||
<tr> | ||
<td colspan="2" style="height: 1px; background-color: #3E426A; margin-bottom: 10px;"></td> | ||
</tr> | ||
<tr> | ||
<td colspan="2" style="font-size: 14px; font-weight: 300; text-align: center; color: #686868; padding-top: 5px;"> | ||
© 2024 Re:coding Service, All rights reserved. | ||
</td> | ||
</tr> | ||
</table> | ||
</div> | ||
</body> | ||
</html> |
This file was deleted.
Oops, something went wrong.