GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Merge branch 'develop' of https://github.com/Team-O2/Back-end2 into d… · Team-O2/Back-end2@390fb0c

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • src
    • library
      • emailRegister.ejs
    • service
      • userService.ts
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎src/library/emailRegister.ejs‎

Copy file name to clipboard
+204Lines changed: 204 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,204 @@
1+
<html>
2+
3+
<head>
4+
<style>
5+
p {
6+
margin: 0;
7+
}
8+
9+
.container {
10+
width: 100%;
11+
-ms-flex-direction: column;
12+
flex-direction: column;
13+
align-items: center;
14+
}
15+
16+
.logo {
17+
width: 80px;
18+
height: 80px;
19+
}
20+
21+
.content {
22+
width: 100%;
23+
padding: 0 60px;
24+
padding-top: 20px;
25+
26+
flex-direction: column;
27+
align-items: flex-start;
28+
}
29+
30+
.title {
31+
all: unset;
32+
margin-bottom: 30px;
33+
font-size: 36px;
34+
font-weight: bold;
35+
font-stretch: normal;
36+
font-style: normal;
37+
line-height: 1.22;
38+
letter-spacing: -0.5px;
39+
text-align: left;
40+
color: #000;
41+
}
42+
43+
.title--blue {
44+
color: #03b6ce;
45+
}
46+
47+
.info-wrap {
48+
width: 560px;
49+
margin-bottom: 50px;
50+
padding: 25px;
51+
background-color: #f7f7f7;
52+
53+
font-display: column;
54+
}
55+
56+
.info {
57+
margin-bottom: 10px;
58+
font-display: row;
59+
font-size: 14px;
60+
font-weight: 600;
61+
font-stretch: normal;
62+
font-style: normal;
63+
line-height: normal;
64+
letter-spacing: normal;
65+
text-align: left;
66+
color: #3d3d3d;
67+
}
68+
69+
.info__category {
70+
width: 135px;
71+
}
72+
73+
.schedule {
74+
width: 100%;
75+
margin-bottom: 60px;
76+
77+
font-display: column;
78+
align-items: flex-start;
79+
}
80+
81+
.schedule__title {
82+
all: unset;
83+
margin-bottom: 18px;
84+
font-size: 16px;
85+
font-weight: bold;
86+
font-stretch: normal;
87+
font-style: normal;
88+
line-height: 1.38;
89+
letter-spacing: -0.5px;
90+
text-align: left;
91+
color: #000;
92+
}
93+
94+
.schedule__text {
95+
font-size: 14px;
96+
font-weight: normal;
97+
font-stretch: normal;
98+
font-style: normal;
99+
line-height: 1.79;
100+
letter-spacing: -0.5px;
101+
text-align: left;
102+
color: #242424;
103+
}
104+
105+
.button {
106+
all: unset;
107+
cursor: pointer;
108+
width: 278px;
109+
height: 50px;
110+
margin-bottom: 130px;
111+
background-color: #03b6ce;
112+
font-size: 16px;
113+
font-weight: bold;
114+
font-stretch: normal;
115+
font-style: normal;
116+
line-height: 1.5;
117+
letter-spacing: -0.5px;
118+
text-align: center;
119+
color: white;
120+
}
121+
122+
.footer {
123+
width: 100%;
124+
125+
flex-direction: column;
126+
align-items: flex-start;
127+
}
128+
129+
.footer .logo--text {
130+
width: 130px;
131+
height: 16px;
132+
margin-bottom: 6px;
133+
}
134+
135+
.footer .copyright {
136+
font-size: 12px;
137+
font-weight: normal;
138+
font-stretch: normal;
139+
font-style: normal;
140+
line-height: 1.33;
141+
letter-spacing: normal;
142+
text-align: left;
143+
color: #8b8b8b;
144+
}
145+
</style>
146+
</head>
147+
148+
<body>
149+
<div class="container">
150+
<div style="background: url('https://o2-server.s3.ap-northeast-2.amazonaws.com/origin/Logo.png')" class="logo" />
151+
<article class="content">
152+
<h1 class="title">
153+
<%= nickname %>님의 <span class="title--blue">신청내역</span>을
154+
<br />안내해 드립니다.
155+
</h1>
156+
<section class="info-wrap">
157+
<div class="info">
158+
<span class="info__category" style="margin-right: 30px;">참여 Learn Myself</span>
159+
<span class="info__text">
160+
<%= generation %> Learn Myself
161+
</span>
162+
</div>
163+
<div class="info">
164+
<span class="info__category" style="margin-right: 74px;">챌린지 기간</span>
165+
<span class="info__text">
166+
<%= startM %>월 <%= startD %>일 <%= startDay %>요일 ~ <%= endM %>월 <%= endD %>일 <%= endDay %>요일
167+
</span>
168+
</div>
169+
<div class="info" style="margin-bottom: 0;">
170+
<span class="info__category" style="margin-right: 42px;">신청 챌린지 개수</span>
171+
<span class="info__text">
172+
한 주에 <%= challengeNum %>개
173+
</span>
174+
</div>
175+
</section>
176+
<section class="schedule">
177+
<h2 class="schedule__title">진행일정</h2>
178+
<p class="schedule__text">1. <%= startM %>월 <%= startD %>일(<%= startDay %>)부터 <%= endM %>월 <%= endD %>일(
179+
<%= endDay %>)까지 진행됩니다.
180+
</p>
181+
<p class="schedule__text">2. 시작일이 되면 Open Together 홈페이지에 '<%= generation %>' 페이지가 오픈될 예정입니다.</p>
182+
<p class="schedule__text">3. 글쓰기 버튼을 클릭해 하루의 회고를 작성해주세요!</p>
183+
<br />
184+
<p class="schedule__text">
185+
<b>주의사항 3가지</b>도 꼭 기억해주세요 😎
186+
</p>
187+
<br />
188+
<p class="schedule__text">1. 신청 때 선택하신 한 주 당 회고 작성 개수는 '<%= challengeNum %>개'입니다! 변경이 불가하니 참고해주세요.</p>
189+
<p class="schedule__text">
190+
2. 한 주에 2개 이상의 회고 작성을 선택하신 분들은 달성률 80%를 넘기면
191+
<br />&nbsp;&nbsp;&nbsp;&nbsp;'Learn Myself 배지'를 받을 수 있습니다.
192+
</p>
193+
<p class="schedule__text">3. 회고 작성 시 광고성 글, 카테고리와 무관한 내용은 무통보 삭제될 수 있으니 주의해주세요.</p>
194+
</section>
195+
</article>
196+
<!-- <button class="button" onclick="window.location.href='https://www.opentogether-o2.com'">신청한 챌린지 바로가기</button> -->
197+
<footer class="footer">
198+
<div style="background: url('https://o2-server.s3.ap-northeast-2.amazonaws.com/origin/Frame.png');" class="logo--text" />
199+
<p class="copyright">Copyright © 2021 Open Together</p>
200+
</footer>
201+
</div>
202+
</body>
203+
204+
</html>
Collapse file

‎src/service/userService.ts‎

Copy file name to clipboardExpand all lines: src/service/userService.ts
+49-1Lines changed: 49 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@ import { userInfo } from "os";
2929
import { CodeArtifact } from "aws-sdk";
3030
import moment from "moment";
3131

32+
const week = ["일", "월", "화", "수", "목", "금", "토"];
33+
3234
/**
3335
* @User_마이페이지_Info
3436
* @route Get user/mypage/info
@@ -899,7 +901,7 @@ const postRegister = async (userID: number, body?: userDTO.registerReqDTO) => {
899901

900902
const user = await User.findOne({
901903
where: { id: userID },
902-
attributes: ["isAdmin"],
904+
attributes: ["isAdmin", "email", "nickname"],
903905
});
904906

905907
// 2. 유저 id가 관리자 id임
@@ -943,6 +945,52 @@ const postRegister = async (userID: number, body?: userDTO.registerReqDTO) => {
943945
return -5;
944946
}
945947

948+
// email 전송
949+
let emailTemplate: string;
950+
ejs.renderFile(
951+
"src/library/emailRegister.ejs",
952+
{
953+
nickname: user.nickname,
954+
generation:
955+
admin.id === 1
956+
? "1st"
957+
: admin.id === 2
958+
? "2nd"
959+
: String(admin.id) + "nd",
960+
startM: admin.challengeStartDT.getMonth() + 1,
961+
startD: admin.challengeStartDT.getDate(),
962+
startDay: week[admin.challengeStartDT.getDay()],
963+
endM: admin.challengeEndDT.getMonth() + 1,
964+
endD: admin.challengeEndDT.getDate(),
965+
endDay: week[admin.challengeEndDT.getDay()],
966+
challengeNum: body.challengeNum,
967+
},
968+
(err, data) => {
969+
if (err) {
970+
console.log(err);
971+
}
972+
emailTemplate = data;
973+
}
974+
);
975+
976+
const mailOptions = {
977+
front: process.env.EMAIL_ADDRESS,
978+
to: user.email,
979+
subject: "O2 챌린지 신청내역입니다.",
980+
text: "",
981+
html: emailTemplate,
982+
};
983+
984+
emailSender.sendMail(mailOptions, (error, info) => {
985+
if (error) {
986+
console.log(error);
987+
return -6;
988+
} else {
989+
console.log("success");
990+
}
991+
emailSender.close();
992+
});
993+
946994
await Generation.create({
947995
generation: admin.id,
948996
userID,

0 commit comments

Comments
0 (0)
You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.