Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

KWoC mailing templates and Corresponding Changes #7

Open
wants to merge 33 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
15ed150
KWoC Templates
manojxplores Jul 23, 2023
5409588
updated-changes
manojxplores Jul 24, 2023
c835fbc
KWoC-mailing-templates
manojxplores Aug 8, 2023
01ed722
updates-templates
manojxplores Aug 26, 2023
a71b39f
changesdone
manojxplores Aug 28, 2023
311c987
updatedchanges
manojxplores Sep 6, 2023
65c96ad
Added kwoc discord/slack links
manojxplores Sep 6, 2023
a1aaf6c
change: file name and other sugggestions
manojxplores Sep 6, 2023
b75b747
refactor: renamed in lowercase letters
harshkhandeparkar Sep 11, 2023
b62ad3b
feat: rephrased mid-evals reminder
harshkhandeparkar Sep 11, 2023
2a21146
feat: small changes for consistency and fixed errors
harshkhandeparkar Sep 11, 2023
731743d
Updated-KWoC-Template-with-CSS
manojxplores Oct 26, 2023
e85c905
minor-changes-in-template
manojxplores Nov 6, 2023
a492222
added HTML
tejasexpress Nov 9, 2023
2573d88
ignored: .DS_Store
proffapt Nov 29, 2023
0f83bc5
Removed txt basic html versions of the template
proffapt Nov 29, 2023
0cd82b9
feat: Merged one-to-one.py and bcc.py into kmail.py
proffapt Nov 29, 2023
619f108
feat: Added almost all the templates
proffapt Nov 29, 2023
51dadac
feat: Implmemented variable mappings for the templates added till now
proffapt Nov 29, 2023
f425248
feat: Get project name from the project_link itself
proffapt Nov 29, 2023
4fa40e9
feat: Updated documentation with templates added till now
proffapt Nov 29, 2023
8415466
fix: Warning and note syntaxes
proffapt Nov 29, 2023
666de3b
feat: Convert all selection templates into html
proffapt Nov 29, 2023
f1fb7d2
feat: Made html default and compulsory format
proffapt Nov 29, 2023
e361efe
feat: Seperated unique part for kwoc templates into a core_template.h…
proffapt Nov 29, 2023
b702f9f
fix: Full-stop was also hyperlinked
proffapt Nov 29, 2023
78511cc
Added blog_submission_guidelines.html
manojxplores Jan 16, 2024
9556572
feat: adjusted for oto kwoc cirtificate mailing
lurkingryuu Feb 10, 2024
adf4956
Need to add changes for mentor certificate mail
soumili202 Feb 10, 2024
0297be3
Necessary Templates Added for KWOC Mailing
soumili202 Feb 10, 2024
28883ca
Update variables for KWoC 2024
Faizan2005 Oct 20, 2024
a9fec00
Revert back changes, Add '2024' in blog_submission_guidelines.html, A…
Faizan2005 Nov 6, 2024
7fa73d7
Update design of email-template
Faizan2005 Nov 18, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
csv
*.json
__pycache__
.DS_Store
58 changes: 40 additions & 18 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@

Automates the mailing process for KOSS during various events like KWoC and selections.

> **Warning** Always do a test run before using the scripts, there are many things which might go wrong and we can't afford sending broken/incorrect mails to the reciepients.
> [!Warning]
> Always do a test run before using the scripts, there are many things which might go wrong and we can't afford sending broken/incorrect mails to the reciepients.

### How to use

Expand All @@ -11,52 +12,73 @@ Automates the mailing process for KOSS during various events like KWoC and selec
1. Either use already available [templates](./templates) or create a new template with the conventions mentioned in [about templates](./templates/README.md).

2. Make sure the the column names for `name` and `email` entries are one of those mentioned in [variable_mappings.py](./templates/variable_mappings.py).

3. Make sure the files are stored in correct directory:
- Templates files must be stored in `./templates/`.
- CSV files must be stored in `./csv/`,
- CSV files must be stored in `./csv/`,

Hence no need to mention them again while specifying the location, just speciy the location after these default directories.

4. Use the script according to your needs, `bcc.py` or `one-to-one.py`. Both follow same method of execution
4. Use the script according to your needs, `kmail.py`.

```bash
python3 script.py <template> <csv_file> (OPTIONAL)<variables with same value for all mails>
python3 kmail.py <bcc/oto> <template> <csv_file> (OPTIONAL)<variables with same value for all mails>
```

### Executing the scripts

Here are one example for each case supported:
Here is one example for each of the supported cases:

#### Selections

```bash
python3 one-to-one.py selections/onboarding onboarding.csv number_of_applicants="250+"
python3 one-to-one.py selections/task day1.csv deadline="Monday, 9 June 2023"
python3 bcc.py selections/rejection rejected.csv
python3 bcc.py selections/round1-interview-slot r1d1.csv slot_time="Tuesday, 3 June 2023, 10:00 PM - 11:00 PM" lobby_link="https://meet.google.com/xxx-xxxx-xxx"
python3 bcc.py selections/round2-interview-slot r2d2.csv slot_time="Tuesday, 3 June 2023, 10:00 PM - 11:00 PM" lobby_link="https://meet.google.com/xxx-xxxx-xxx"
python3 kmail.py oto selections/onboarding onboarding.csv number_of_applicants="250+"
python3 kmail.py oto selections/task day1.csv deadline="Monday, 9 June 2023"
python3 kmail.py bcc selections/rejection rejected.csv
python3 kmail.py bcc selections/round1-interview-slot r1d1.csv slot_time="Tuesday, 3 June 2023, 10:00 PM - 11:00 PM" lobby_link="https://meet.google.com/xxx-xxxx-xxx"
python3 kmail.py bcc selections/round2-interview-slot r2d2.csv slot_time="Tuesday, 3 June 2023, 10:00 PM - 11:00 PM" lobby_link="https://meet.google.com/xxx-xxxx-xxx"
```

#### KWoC

```bash
python3 kmail.py oto kwoc/project_approval approved_projects.csv year="2023" mentor_manual_link="https://drive.google.com/file/d/1qNl6RGQ6dnkFu20L3LwC4bcBFOOpd_vV/view"
python3 kmail.py oto kwoc/project_rejection rejected_projects.csv year="2023"
python3 kmail.py bcc kwoc/mid_eval_reminder students.csv year="2023" mid_eval_date="December 26th, 2023"
python3 kmail.py bcc kwoc/mid_eval_qualified students_qualified_mid_evals.csv year="2023"
python3 kmail.py bcc kwoc/mid_eval_disqualified students_disqualified_mid_evals.csv year="2023"
python3 kmail.py bcc kwoc/end_eval_reminder students_qualified_mid_evals.csv year="2023" end_eval_date="January 9th, 2023"
python3 kmail.py bcc kwoc/end_eval_qualified students_qualified_end_evals.csv year="2023"
python3 kmail.py bcc kwoc/end_eval_disqualified students_disqualified_end_evals.csv year="2023"
```

### Generating token for GMail enabled googleapi

1. Follow the steps at [Gmail API - Python Quickstart](https://developers.google.com/gmail/api/quickstart/python) guide to get `credentials.json`.
> **Note** `credentials.json` is permanent until you delete it in your google clound console.<br>
> And make sure to add `[email protected]` as a test user in case you made the app internal.

> [!Note]
> `credentials.json` is permanent until you delete it in your google clound console.<br>
> And make sure to add `[email protected]` as a test user in case you made the app internal.

2. Follow the steps below to generate `token.json`:
- Download [gentokenjson.py](https://gist.github.com/proffapt/adbc716a427c036f238e828d8995e1a3) in the same folder containing `credentials.json`
- Import the required module
- Import the required modules

```bash
pip install google-auth-oauthlib
```

- Execute `gentokenjson.py` with `send` argument

```bash
python3 gentokenjson.py send
```

- Browser window will open and ask you to select the account, choose the one receiving OTP for login
- Allow permission on that email to use just enabled __GMAIL API__
- Click on `Continue` instead of __Back To Safety__
- Then press `Continue` again
- `token.json` will be generated in same folder as that of `credentials.json`

> **Warning** `token.json` expires after sometime. So make sure to check that in your projects and keep refreshing it.
> [!Warning]
> `token.json` expires after sometime. So make sure to check that in your projects and keep refreshing it.
138 changes: 0 additions & 138 deletions bcc.py

This file was deleted.

Loading