1212import org .thymeleaf .spring6 .SpringTemplateEngine ;
1313
1414import java .util .List ;
15+ import java .util .Map ;
1516
1617@ Service
1718@ RequiredArgsConstructor
@@ -23,7 +24,7 @@ public void sendResultMail(String to, String projectTitle, String applicantName,
2324 Context context = new Context ();
2425 context .setVariable ("projectTitle" , projectTitle );
2526 context .setVariable ("applicantName" , applicantName );
26- context .setVariable ("link" , "https://www.naver.com " );
27+ context .setVariable ("link" , "https://www.gathering.work " );
2728
2829 String templateName = isApproved ? "approve" : "reject" ;
2930 String htmlContent = templateEngine .process (templateName , context );
@@ -36,7 +37,7 @@ public void sendCloseMailToAuthor(String to, String projectTitle, String authorN
3637 Context context = new Context ();
3738 context .setVariable ("projectTitle" , projectTitle );
3839 context .setVariable ("authorName" , authorName );
39- context .setVariable ("link" , "https://www.naver.com " );
40+ context .setVariable ("link" , "https://www.gathering.work " );
4041
4142 String htmlContent = templateEngine .process ("deadline_author" , context );
4243 String subject = "[Gathering] 프로젝트 마감 안내" ;
@@ -48,7 +49,7 @@ public void sendCloseMailToApplicant(String to, String projectTitle, String appl
4849 Context context = new Context ();
4950 context .setVariable ("projectTitle" , projectTitle );
5051 context .setVariable ("applicantName" , applicantName );
51- context .setVariable ("link" , "https://www.naver.com " );
52+ context .setVariable ("link" , "https://www.gathering.work " );
5253
5354 String htmlContent = templateEngine .process ("deadline_applicant" , context );
5455 String subject = "[Gathering] 지원 프로젝트 마감 안내" ;
@@ -60,25 +61,39 @@ public void sendNewApplyMail(String to, String projectTitle, String authorName)
6061 Context context = new Context ();
6162 context .setVariable ("projectTitle" , projectTitle );
6263 context .setVariable ("authorName" , authorName );
63- context .setVariable ("link" , "https://www.naver.com " );
64+ context .setVariable ("link" , "https://www.gathering.work " );
6465
6566 String htmlContent = templateEngine .process ("notify" , context );
6667 String subject = "[Gathering] 새 지원서가 도착했습니다!" ;
6768
6869 sendHtmlMail (to , subject , htmlContent );
6970 }
7071
71- public void sendProjectDeletionNotice ( List < String > recipients ) {
72+ public void sendProjectDeletetionNotice ( String authorEmail , String projectTitle , String authorName ) {
7273 Context context = new Context ();
73- //context.setVariable("projectTitle", projectTitle);
74- //context.setVariable("authorName", authorName);
75- context .setVariable ("link" , "https://www.gathering.work" );
74+ context .setVariable ("projectTitle" , projectTitle );
75+ context .setVariable ("authorName" , authorName );
7676
77- String htmlContent = templateEngine .process ("notify" , context );
78- String subject = "[Gathering] 삭제" ;
77+ String htmlContent = templateEngine .process ("delete_notify_author" , context );
78+ String subject = "[Gathering] 게더링 모집글 삭제 안내" ;
79+
80+ sendHtmlMail (authorEmail , subject , htmlContent );
81+ }
82+
83+ public void sendProjectDeletionNotice (Map <String , String > recipients , String projectTitle ) {
84+ String subject = "[Gathering] 모집글 삭제 안내" ;
85+
86+ for (Map .Entry <String , String > recipient : recipients .entrySet ()) {
87+ String emailAddress = recipient .getKey ();
88+ String applicantName = recipient .getValue ();
89+
90+ Context context = new Context ();
91+ context .setVariable ("projectTitle" , projectTitle );
92+ context .setVariable ("applicantName" , applicantName );
93+
94+ String htmlContent = templateEngine .process ("delete_notify_applicant" , context );
7995
80- for (String to : recipients ) {
81- sendHtmlMail (to , subject , htmlContent );
96+ sendHtmlMail (emailAddress , subject , htmlContent );
8297 }
8398 }
8499
0 commit comments