Skip to content

Commit cdfa04a

Browse files
Vayrastheanmolsharma
authored andcommitted
added join cohort confirmation email
1 parent cb9b854 commit cdfa04a

File tree

7 files changed

+421
-0
lines changed

7 files changed

+421
-0
lines changed
Lines changed: 321 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,321 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="UTF-8">
5+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
6+
<title>Welcome to <%~ it.cohortName %> Cohort - Bitshala</title>
7+
<style>
8+
body {
9+
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
10+
line-height: 1.6;
11+
color: #333;
12+
max-width: 600px;
13+
margin: 0 auto;
14+
padding: 20px;
15+
background-color: #f4f4f4;
16+
}
17+
.container {
18+
background-color: #ffffff;
19+
border-radius: 8px;
20+
padding: 40px;
21+
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
22+
}
23+
.header {
24+
text-align: center;
25+
margin-bottom: 30px;
26+
}
27+
.logo {
28+
font-size: 32px;
29+
font-weight: bold;
30+
color: #f7931a;
31+
margin-bottom: 10px;
32+
}
33+
h1 {
34+
color: #2c3e50;
35+
font-size: 28px;
36+
margin-bottom: 10px;
37+
}
38+
.success-badge {
39+
display: inline-block;
40+
background-color: #27ae60;
41+
color: white;
42+
padding: 6px 16px;
43+
border-radius: 20px;
44+
font-size: 14px;
45+
font-weight: 600;
46+
margin-bottom: 20px;
47+
}
48+
.greeting {
49+
font-size: 18px;
50+
color: #34495e;
51+
margin-bottom: 20px;
52+
}
53+
.content {
54+
margin-bottom: 30px;
55+
}
56+
.cohort-info {
57+
background-color: #fff8e1;
58+
border-left: 4px solid #f7931a;
59+
padding: 20px;
60+
margin: 25px 0;
61+
border-radius: 4px;
62+
}
63+
.cohort-info h2 {
64+
color: #f7931a;
65+
font-size: 20px;
66+
margin-top: 0;
67+
margin-bottom: 15px;
68+
}
69+
.info-row {
70+
display: flex;
71+
margin: 10px 0;
72+
padding: 8px 0;
73+
border-bottom: 1px solid #ffe082;
74+
}
75+
.info-row:last-child {
76+
border-bottom: none;
77+
}
78+
.info-label {
79+
font-weight: 600;
80+
color: #7f8c8d;
81+
min-width: 100px;
82+
}
83+
.info-value {
84+
color: #2c3e50;
85+
font-weight: 500;
86+
}
87+
.next-steps {
88+
margin: 30px 0;
89+
}
90+
.section-title {
91+
font-size: 20px;
92+
font-weight: 600;
93+
color: #2c3e50;
94+
margin-bottom: 20px;
95+
display: flex;
96+
align-items: center;
97+
}
98+
.step-card {
99+
background-color: #f8f9fa;
100+
border-left: 4px solid #f7931a;
101+
padding: 20px;
102+
margin: 15px 0;
103+
border-radius: 6px;
104+
}
105+
.step-number {
106+
display: inline-block;
107+
background-color: #f7931a;
108+
color: white;
109+
width: 28px;
110+
height: 28px;
111+
border-radius: 50%;
112+
text-align: center;
113+
line-height: 28px;
114+
font-weight: bold;
115+
margin-right: 12px;
116+
}
117+
.step-title {
118+
font-size: 16px;
119+
font-weight: 600;
120+
color: #2c3e50;
121+
margin-bottom: 8px;
122+
}
123+
.step-description {
124+
color: #5a6c7d;
125+
margin-left: 40px;
126+
}
127+
.cta-button {
128+
display: inline-block;
129+
background-color: #f7931a;
130+
color: white;
131+
padding: 14px 32px;
132+
text-decoration: none;
133+
border-radius: 6px;
134+
margin: 15px 0;
135+
font-weight: 600;
136+
font-size: 16px;
137+
text-align: center;
138+
}
139+
.cta-button:hover {
140+
background-color: #e08912;
141+
}
142+
.important-box {
143+
background-color: #e8f5e9;
144+
border: 2px solid #4caf50;
145+
border-radius: 6px;
146+
padding: 20px;
147+
margin: 25px 0;
148+
}
149+
.important-box h3 {
150+
color: #2e7d32;
151+
margin-top: 0;
152+
margin-bottom: 15px;
153+
font-size: 18px;
154+
}
155+
.important-box ul {
156+
margin: 10px 0;
157+
padding-left: 20px;
158+
}
159+
.important-box li {
160+
margin: 8px 0;
161+
color: #1b5e20;
162+
}
163+
.resources {
164+
margin: 25px 0;
165+
}
166+
.resource-link {
167+
display: block;
168+
padding: 15px;
169+
margin: 12px 0;
170+
background-color: #f8f9fa;
171+
border-radius: 6px;
172+
text-decoration: none;
173+
color: #2c3e50;
174+
transition: all 0.2s;
175+
border: 1px solid #e0e0e0;
176+
}
177+
.resource-link:hover {
178+
background-color: #e9ecef;
179+
border-color: #f7931a;
180+
}
181+
.resource-link strong {
182+
color: #f7931a;
183+
font-size: 16px;
184+
}
185+
.footer {
186+
margin-top: 40px;
187+
padding-top: 20px;
188+
border-top: 1px solid #e0e0e0;
189+
text-align: center;
190+
color: #7f8c8d;
191+
font-size: 14px;
192+
}
193+
.footer strong {
194+
color: #2c3e50;
195+
}
196+
</style>
197+
</head>
198+
<body>
199+
<div class="container">
200+
<div class="header">
201+
<div class="logo">₿ Bitshala</div>
202+
<div class="success-badge">✓ Enrollment Confirmed</div>
203+
<h1>Welcome to the Cohort!</h1>
204+
</div>
205+
206+
<div class="content">
207+
<p class="greeting">Hello <%~ it.userName %>,</p>
208+
209+
<p style="font-size: 16px; line-height: 1.8;">
210+
Congratulations! You've successfully joined our <strong><%~ it.cohortName %></strong> cohort.
211+
We're thrilled to have you as part of our learning community and can't wait to begin this journey with you!
212+
</p>
213+
</div>
214+
215+
<div class="cohort-info">
216+
<h2>📅 Your Cohort Details</h2>
217+
<div class="info-row">
218+
<div class="info-label">Cohort:</div>
219+
<div class="info-value"><%~ it.cohortName %></div>
220+
</div>
221+
<div class="info-row">
222+
<div class="info-label">Start Date:</div>
223+
<div class="info-value"><%~ it.startDate %></div>
224+
</div>
225+
<div class="info-row">
226+
<div class="info-label">End Date:</div>
227+
<div class="info-value"><%~ it.endDate %></div>
228+
</div>
229+
</div>
230+
231+
<div class="next-steps">
232+
<div class="section-title">🚀 What's Next?</div>
233+
234+
<div class="step-card">
235+
<div class="step-title">
236+
<span class="step-number">1</span>
237+
Join the Classroom
238+
</div>
239+
<div class="step-description">
240+
Access your cohort's classroom and resources to get started with the course materials.
241+
<% if (it.classroomUrl) { %>
242+
<br><br>
243+
<a href="<%~ it.classroomUrl %>" class="cta-button">Access Classroom</a>
244+
<% } else { %>
245+
<br><br>
246+
<em>Classroom link will be shared soon</em>
247+
<% } %>
248+
</div>
249+
</div>
250+
251+
<div class="step-card">
252+
<div class="step-title">
253+
<span class="step-number">2</span>
254+
Connect on Discord
255+
</div>
256+
<div class="step-description">
257+
Join our community and meet your cohort members. This is where we'll share announcements, discuss topics, and support each other.
258+
<br><br>
259+
<a href="https://discord.gg/bitshala" class="cta-button">Join Discord</a>
260+
</div>
261+
</div>
262+
263+
<div class="step-card">
264+
<div class="step-title">
265+
<span class="step-number">3</span>
266+
Prepare for Week 1
267+
</div>
268+
<div class="step-description">
269+
Review the course materials, set up your development environment, and introduce yourself to the cohort!
270+
</div>
271+
</div>
272+
</div>
273+
274+
<div class="important-box">
275+
<h3>⚡ Important Information</h3>
276+
<ul>
277+
<li>Weekly sessions and group discussions will be scheduled</li>
278+
<li>Exercise submissions and deadlines will be posted in the classroom</li>
279+
<li>Stay active in Discord for announcements and community support</li>
280+
<li>Don't hesitate to ask questions - we're all here to learn together!</li>
281+
</ul>
282+
</div>
283+
284+
<div class="section resources">
285+
<div class="section-title">🔗 Helpful Resources</div>
286+
287+
<a href="https://bitshala.org" class="resource-link">
288+
<strong>📚 Course Materials</strong><br>
289+
Access all learning resources and documentation
290+
</a>
291+
292+
<a href="https://discord.gg/bitshala" class="resource-link">
293+
<strong>💬 Technical Support</strong><br>
294+
Get help from our team and community on Discord
295+
</a>
296+
297+
<a href="https://bitshala.org/guidelines" class="resource-link">
298+
<strong>📋 Community Guidelines</strong><br>
299+
Learn about our community values and expectations
300+
</a>
301+
</div>
302+
303+
<div style="text-align: center; margin: 40px 0 20px 0; padding: 30px; background-color: #fef5e7; border-radius: 8px;">
304+
<p style="font-size: 18px; color: #2c3e50; margin: 0; font-weight: 600;">
305+
We're excited to begin this learning journey with you!
306+
</p>
307+
<p style="color: #7f8c8d; margin-top: 10px;">
308+
Let's start building together 🚀
309+
</p>
310+
</div>
311+
312+
<div class="footer">
313+
<p>If you have any questions or need assistance, don't hesitate to reach out to our team on Discord.</p>
314+
<p><strong>The Bitshala Team</strong></p>
315+
<p style="margin-top: 15px; font-size: 12px;">
316+
This is an automated message. Please do not reply to this email.
317+
</p>
318+
</div>
319+
</div>
320+
</body>
321+
</html>
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
Hello <%~ it.userName %>,
2+
3+
Welcome to Bitshala's <%~ it.cohortName %> Cohort!
4+
5+
Congratulations! You've successfully joined our <%~ it.cohortName %> cohort. We're thrilled to have you as part of our learning community!
6+
7+
Cohort Details:
8+
- Cohort: <%~ it.cohortName %>
9+
- Start Date: <%~ it.startDate %>
10+
- End Date: <%~ it.endDate %>
11+
12+
What's Next?
13+
14+
1. Join the Classroom
15+
Access your cohort's classroom and resources:
16+
<%~ it.classroomUrl || 'Link will be shared soon' %>
17+
18+
2. Connect on Discord
19+
Join our community and meet your cohort members:
20+
https://discord.gg/bitshala
21+
22+
3. Prepare for Week 1
23+
- Review the course materials
24+
- Set up your development environment
25+
- Introduce yourself to the cohort
26+
27+
Important Information:
28+
- Weekly sessions and group discussions will be scheduled
29+
- Exercise submissions and deadlines will be posted in the classroom
30+
- Stay active in Discord for announcements and community support
31+
32+
Resources:
33+
- Course Materials: https://bitshala.org
34+
- Technical Support: Available on Discord
35+
- Community Guidelines: https://bitshala.org/guidelines
36+
37+
We're excited to begin this learning journey with you. If you have any questions or need assistance, don't hesitate to reach out to our team on Discord.
38+
39+
Let's start building together!
40+
41+
Best regards,
42+
The Bitshala Team

src/cohorts/cohorts.service.ts

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ import { CohortWaitlist } from '@/entities/cohort-waitlist.entity';
2626
import { APITask } from '@/entities/api-task.entity';
2727
import { TaskType } from '@/task-processor/task.enums';
2828
import { MailService } from '@/mail/mail.service';
29+
import { formatDate } from '@/utils/data.utils';
2930

3031
@Injectable()
3132
export class CohortsService {
@@ -437,6 +438,20 @@ export class CohortsService {
437438
await this.apiTaskRepository.save(apiTask);
438439
},
439440
);
441+
442+
// Send cohort joining confirmation email
443+
const userName =
444+
user.name || user.discordGlobalName || user.discordUserName;
445+
const classroomUrl = cohort.weeks[0]?.classroomUrl || undefined;
446+
447+
await this.mailService.sendCohortJoiningConfirmationEmail(
448+
user.email,
449+
userName,
450+
cohort.type,
451+
cohort.startDate,
452+
cohort.endDate,
453+
classroomUrl,
454+
);
440455
}
441456

442457
async joinCohortWaitlist(

src/mail/mail.enum.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
export enum MailTemplate {
22
WelcomeToWaitlist = 'welcome-to-waitlist',
3+
CohortJoiningConfirmation = 'cohort-joining-confirmation',
34
}

0 commit comments

Comments
 (0)