Skip to content

Commit

Permalink
feat: add whatsapp invite to email
Browse files Browse the repository at this point in the history
  • Loading branch information
LordHarsh committed Sep 22, 2024
1 parent 62d27e7 commit 6e7415f
Show file tree
Hide file tree
Showing 9 changed files with 51 additions and 16 deletions.
6 changes: 5 additions & 1 deletion server/.env.example
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,8 @@ LOG_LEVEL='debug'
MAILER_SEND_API_KEY='add-mailer-send-api-key-here'
SHEETS_KEY_URL='add-sheets-key-url-here'
KEY_PATH='add-key-path-here'
GSHEET_ID='add-gsheet-id-here'
GSHEET_ID='add-gsheet-id-here'
TECHNICAL_WHATSAPP='add-technical-whatsapp-number-here'
CORPORATE_WHATSAPP='add-corporate-whatsapp-number-here'
CREATIVE_WHATSAPP='add-creative-whatsapp-number-here'
RESEARCH_WHATSAPP='add-research-whatsapp-number-here'
28 changes: 21 additions & 7 deletions server/public/confirmation.html
Original file line number Diff line number Diff line change
Expand Up @@ -307,7 +307,7 @@
<div
align="center"
class="alignment"
style="line-height: 10px; "
style="line-height: 10px"
>
<div style="max-width: 550px">
<img
Expand Down Expand Up @@ -666,9 +666,10 @@
"
>
<p style="margin: 0; margin-bottom: 16px">
We’re thrilled that you’ve applied in the {{=it.domain}} domain and are
eager to learn more about your unique
skills and potential.
We’re thrilled that you’ve applied in the
{{=it.domain}} domain and are eager to
learn more about your unique skills and
potential.
</p>
<p style="margin: 0">
At
Expand Down Expand Up @@ -854,9 +855,22 @@
target="_blank"
title="DS Community"
>Data Science Community SRM</a
>. You can also follow us on our social
media channels for the latest news and
insights.
>. Join our whatsapp recruitment group to
get further updates.<br /><strong
>Whatsapp Invite: </strong
><a
href='{{=it.whatsapp}}'
rel="noopener"
style="
text-decoration: underline;
color: #6f389f;
"
target="_blank"
title="DS Community"
>{{=it.whatsapp}}</a
><br /><br />
You can also follow us on our social media
channels for the latest news and insights.
</p>
<p style="margin: 0; margin-bottom: 16px">
Thank you once again for your interest.
Expand Down
5 changes: 4 additions & 1 deletion server/public/confirmation.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,10 @@ At Data Science Community SRM, we believe in empowering individuals to grow, inn

What’s Next? Our team is currently reviewing applications. We will reach out to you soon with the next steps in the selection process. Stay tuned for updates!

In the meantime, we invite you to explore more about us and what we do by visiting our website: Data Science Community SRM. You can also follow us on our social media channels for the latest news and insights.
In the meantime, we invite you to explore more about us and what we do by visiting our website: Data Science Community SRM. Join our whatsapp recruitment group to get further updates.
Whatsapp Invite: {{=it.whatsapp}}

You can also follow us on our social media channels for the latest news and insights.

Thank you once again for your interest. We’re excited to see how you can contribute to our thriving community!

Expand Down
14 changes: 8 additions & 6 deletions server/src/api/corporate/corporate.services.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { sendConfirmation } from "../../shared/utils/confirm";
import { getCorporateCollection } from "../../loaders/collections";
import ERRORS from "../../shared/errors";
import { updateSheet } from "../../shared/utils/sheets";
import config from "../../config";

export const registerCorporate = async (
firstName: string,
Expand All @@ -12,7 +13,7 @@ export const registerCorporate = async (
phoneNumber: string,
department: string,
year: number,
subDomain: string,
subDomain: string
) => {
const collection = await getCorporateCollection();
const student = await collection.findOne({ registrationNumber });
Expand All @@ -33,14 +34,15 @@ export const registerCorporate = async (
year,
subDomain,
});

sendConfirmation({
firstName,
lastName,
email: srmEmail,
domain: 'corporate',
})
await updateSheet('Corporate', {
domain: "corporate",
whatsapp: config.whatsapp.corporate,
});
await updateSheet("Corporate", {
id: data.insertedId,
subDomain,
firstName,
Expand All @@ -51,6 +53,6 @@ export const registerCorporate = async (
srmEmail,
personalEmail,
phoneNumber,
})
});
return data;
};
2 changes: 2 additions & 0 deletions server/src/api/creative/creative.services.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { sendConfirmation } from "../../shared/utils/confirm";
import { getCreativeCollection } from "../../loaders/collections";
import ERRORS from "../../shared/errors";
import { updateSheet } from "../../shared/utils/sheets";
import config from "../../config";

export const registerCreative = async (
firstName: string,
Expand Down Expand Up @@ -39,6 +40,7 @@ export const registerCreative = async (
lastName,
email: srmEmail,
domain: 'creative',
whatsapp: config.whatsapp.creative,
})
await updateSheet('Creative', {
id: data.insertedId,
Expand Down
2 changes: 2 additions & 0 deletions server/src/api/research/research.services.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { sendConfirmation } from "../../shared/utils/confirm";
import { getResearchCollection } from "../../loaders/collections";
import ERRORS from "../../shared/errors";
import { updateSheet } from "../../shared/utils/sheets";
import config from "../../config";

export const registerResearch = async (
firstName: string,
Expand Down Expand Up @@ -40,6 +41,7 @@ export const registerResearch = async (
lastName,
email: srmEmail,
domain: "research",
whatsapp: config.whatsapp.research,
})
await updateSheet('Research', {
id: data.insertedId,
Expand Down
2 changes: 2 additions & 0 deletions server/src/api/technical/technical.services.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { sendConfirmation } from "../../shared/utils/confirm";
import { getTechnicalCollection } from "../../loaders/collections";
import ERRORS from "../../shared/errors";
import { updateSheet } from "../../shared/utils/sheets";
import config from "../../config";

export const registerTechnical = async (
firstName: string,
Expand Down Expand Up @@ -40,6 +41,7 @@ export const registerTechnical = async (
lastName,
email: srmEmail,
domain: 'technical',
whatsapp: config.whatsapp.technical,
})
await updateSheet('Technical', {
id: data.insertedId,
Expand Down
6 changes: 6 additions & 0 deletions server/src/config/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,10 @@ export default {
key_url: process.env.SHEETS_KEY_URL!,
key_path: process.env.KEY_PATH!,
},
whatsapp: {
technical: process.env.TECHNICAL_WHATSAPP!,
creative: process.env.CREATIVE_WHATSAPP!,
corporate: process.env.CORPORATE_WHATSAPP!,
research: process.env.RESEARCH_WHATSAPP!,
}
};
2 changes: 1 addition & 1 deletion server/src/shared/utils/confirm.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ interface props {
lastName: string;
email: string;
domain: string;
whatsapp: string;
}

const toTitleCase = (str: string) => {
Expand Down Expand Up @@ -46,6 +47,5 @@ export const sendConfirmation = async (user: props) => {
.setSubject(subject)
.setHtml(htmlContent)
.setText(textContent);

await mailerSend.email.send(emailParams);
};

0 comments on commit 6e7415f

Please sign in to comment.