Skip to content

Commit 64a7394

Browse files
authored
REGISTERATION SUBMIT EMAIL (#56)
2 parents a0c4fb2 + ea44e53 commit 64a7394

5 files changed

Lines changed: 25 additions & 35 deletions

File tree

src/app.service.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,15 @@
11
import { Injectable } from "@nestjs/common";
22
import os from "os";
33
import { config } from "./config/app.config";
4+
import { EmailService } from "./core/email/email.service";
45
import { LoggerService } from "./core/logger/logger.service";
56

67
@Injectable()
78
export class AppService {
8-
constructor(private readonly logger: LoggerService) {}
9+
constructor(
10+
private readonly logger: LoggerService,
11+
private readonly emailService: EmailService,
12+
) {}
913

1014
async getStatus() {
1115
return {

src/core/email/templates/RegistrationConfirmEmail.tsx

Lines changed: 12 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,6 @@ interface RegistrationConfirmEmailProps {
77
name: string;
88
}
99

10-
const CONFIG = {
11-
contactLink: "https://comcamp.io/#contact",
12-
email: "kmutt.comcamp@gmail.com",
13-
};
14-
1510
export default function RegistrationConfirmEmail({ name }: RegistrationConfirmEmailProps) {
1611
return (
1712
<Html>
@@ -21,8 +16,8 @@ export default function RegistrationConfirmEmail({ name }: RegistrationConfirmEm
2116
extend: {
2217
colors: {
2318
zootopia: {
24-
navy: "#464f6a",
25-
blue: "#92a6d2",
19+
navy: "#1d3071",
20+
blue: "#004aad",
2621
orange: "#e98d55",
2722
yellow: "#f2d575",
2823
brown: "#504039",
@@ -42,31 +37,30 @@ export default function RegistrationConfirmEmail({ name }: RegistrationConfirmEm
4237
<Header />
4338

4439
<Section className="bg-white px-6 py-8 text-center">
45-
<Heading className="text-sm font-semibold text-[#92a6d2] m-0 mb-2 tracking-widest uppercase" style={{ textShadow: "0 2px 8px rgba(0,0,0,0.1)" }}>
46-
COMCAMP 37
40+
<Heading className="text-sm font-semibold text-[#1d3071] m-0 mb-2 tracking-widest uppercase" style={{ textShadow: "0 2px 8px rgba(0,0,0,0.1)" }}>
41+
สถานะ
4742
</Heading>
48-
<Text className="text-2xl font-bold m-0 text-[#464f6a]">ยืนยันการสมัครสำเร็จ! 🎉</Text>
43+
<Text className="text-2xl font-bold m-0 text-[#004aad]">ส่งใบสมัครสำเร็จ!</Text>
4944
</Section>
5045

5146
<Section className="px-6 pb-10 pt-4">
52-
<Section className="bg-[#f8f9fc] border-l-4 border-[#e98d55] rounded-lg px-6 py-5 mb-8">
53-
<Text className="text-base leading-relaxed text-[#464f6a] m-0">
54-
สวัสดีครับน้อง <strong className="text-[#504039]">{name}</strong> 🎊
47+
<Section className="bg-[#004aad]/20 border-l-4 border-[#1d3071] rounded-lg px-6 py-5 mb-8">
48+
<Text className="text-base leading-relaxed text-[#004aad] m-0">
49+
สวัสดีครับน้อง <strong className="text-white">{name}</strong>
5550
</Text>
5651
</Section>
5752

5853
<Section className="bg-[#e8f5e9] border-2 border-[#4caf50] rounded-xl px-6 py-6 mb-8 text-center">
59-
<Text className="text-4xl m-0 mb-3"></Text>
60-
<Text className="text-lg font-bold text-[#2e7d32] m-0">การสมัครของน้องได้รับการบันทึกเรียบร้อยแล้ว!</Text>
54+
<Text className="text-lg font-bold text-[#2e7d32] m-0">ใบสมัครของน้องได้รับการบันทึกเรียบร้อยแล้ว!</Text>
6155
</Section>
6256

6357
<Text className="text-base leading-relaxed text-[#504039] mb-6">
64-
ขอขอบคุณที่ให้ความสนใจสมัครเข้าร่วมโครงการ <strong>ComCamp 37</strong> ค่ายคอมพิวเตอร์สำหรับน้อง ๆ มัธยมศึกษาตอนปลายที่จัดโดยภาควิชาวิศวกรรมคอมพิวเตอร์ มหาวิทยาลัยเทคโนโลยีพระจอมเกล้าธนบุรี
58+
ขอขอบคุณที่ให้ความสนใจสมัครเข้าร่วมโครงการ <strong>ComCamp 37</strong> ค่ายคอมพิวเตอร์สำหรับน้อง ๆ ที่จัดโดยภาควิชาวิศวกรรมคอมพิวเตอร์ มหาวิทยาลัยเทคโนโลยีพระจอมเกล้าธนบุรี
6559
</Text>
6660

6761
<Section className="bg-[#f0f4ff] border-l-4 border-[#92a6d2] rounded-lg px-6 py-5 mb-8">
68-
<Text className="text-sm font-bold text-[#464f6a] m-0 mb-3">📋 ขั้นตอนถัดไป:</Text>
69-
<Text className="text-sm leading-relaxed text-[#504039] m-0 mb-2">1. ทีมงานจะตรวจสอบใบสมัครของน้องภายใน 3-5 วันทำการ</Text>
62+
<Text className="text-sm font-bold text-[#004aad] m-0 mb-3">📋 ขั้นตอนถัดไป:</Text>
63+
<Text className="text-sm leading-relaxed text-[#504039] m-0 mb-2">1. ทีมงานจะตรวจสอบใบสมัครของน้อง</Text>
7064
<Text className="text-sm leading-relaxed text-[#504039] m-0 mb-2">2. หากมีข้อมูลที่ต้องแก้ไข น้องจะได้รับอีเมลแจ้งเตือน</Text>
7165
<Text className="text-sm leading-relaxed text-[#504039] m-0 mb-2">3. ติดตามประกาศผลการคัดเลือกได้ที่เว็บไซต์ของค่าย</Text>
7266
<Text className="text-sm leading-relaxed text-[#504039] m-0">4. ตรวจสอบอีเมลเป็นประจำเพื่อไม่พลาดข่าวสารสำคัญ</Text>

src/core/email/templates/layout/Footer.tsx

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,5 @@
11
import { Hr, Img, Link, Section, Text } from "@react-email/components";
22

3-
const CONFIG = {
4-
contactLink: "https://comcamp.io/#contact",
5-
email: "kmutt.comcamp@gmail.com",
6-
};
7-
83
export const Footer = () => {
94
return (
105
<Section className="bg-[#f8f9fc] px-6 py-10 border-t border-[#e8ecf4]">
@@ -22,13 +17,9 @@ export const Footer = () => {
2217
<Text className="text-[13px] leading-relaxed text-[#92a6d2] m-0">
2318
อีเมลฉบับนี้ถูกส่งโดยระบบอัตโนมัติ โปรดอย่าตอบกลับ
2419
<br />
25-
หากมีข้อสงสัยสามารถติดต่อทีมงานได้ที่{" "}
26-
<Link href={`mailto:${CONFIG.email}`} className="text-[#e98d55] no-underline font-semibold">
27-
{CONFIG.email}
28-
</Link>{" "}
29-
หรือ{" "}
30-
<Link href={CONFIG.contactLink} className="text-[#e98d55] no-underline font-semibold">
31-
ช่องทางต่อไปนี้
20+
หากมีข้อสงสัยสามารถติดต่อทีมงานได้ที่ <br />
21+
<Link href={`https://comcamp.io/#contact`} className="text-[#e98d55] no-underline font-semibold">
22+
ติดต่อทีมงาน ComCamp 37
3223
</Link>
3324
</Text>
3425
</Section>

src/core/email/templates/layout/Header.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ export const Header = () => {
99
<Section
1010
className="relative overflow-hidden px-12 text-center"
1111
style={{
12-
background: "linear-gradient(135deg, #464f6a 0%, #92a6d2 100%)",
12+
background: "linear-gradient(135deg, #1d3071 0%, #004aad 100%)",
1313
}}
1414
>
1515
<Img src={CONFIG.logourl} width="160" height="auto" alt="ComCamp 37 Logo" className="mx-auto relative z-10" />

src/modules/application-submit/application-submit.service.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ export class ApplicationSubmitService {
5656
},
5757
});
5858

59+
// Send submit confirm email
5960
const userInfo = await this.prisma.applicationInfo.findUnique({
6061
where: {
6162
std_application_id: applicationSubmitDto.application_id,
@@ -68,9 +69,9 @@ export class ApplicationSubmitService {
6869
},
6970
},
7071
});
71-
// if (userInfo) {
72-
// await this.emailService.sendRegistrationConfirm(userInfo.std_application.std_user.email, `${userInfo.std_info_first_name} ${userInfo.std_info_last_name} (${userInfo.std_info_nick_name})`);
73-
// }
72+
if (userInfo) {
73+
await this.emailService.sendRegistrationConfirm(userInfo.std_application.std_user.email, `${userInfo.std_info_nick_name}`);
74+
}
7475

7576
return updateSubmitStatus;
7677
} catch (e) {

0 commit comments

Comments
 (0)