Refactor - Mail sending and EmailHandler
Maintainers usually reply within 1 day
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 45/100
Research direction
Start with the EmailHandler class: remove the unused self.environment in init, then make setup_smtp_server() populate self.server so get_or_create_smtp_server() works as a getter. Next, move the body and subject strings from each send() method into a new mail_templates.py, and add logging around the actual sending. Done when the checklist items are ticked and the existing mail tests still pass. Renaming the send_() methods and rewording the mails need maintainer input.
Written by the indexing model from the issue text.
Description
EmailHandler specific:
__init__():
- Remove
self.environmentas it is unused
get_or_create_smtp_server()
- method should be fully dynamic. For that
_setup_smtp_server()should not return a server instance but populate theself.serverattribute. Thenget_or_create_smtp_server()calls it if server is not set or returns as if it was a getter.
All send_*() Methods:
- create
mail_templates.pyfile dedicated to store capitalized variables to store Mail body and subject strings - Move mail strings from the
send_*()methods to the newmail_templates.py - Move Subject strings from the
send_*()methods to the newmail_templates.py - If necessary, implement method handling formatting of mail strings
- rename
send_*()methods to more appropriate names where necessary. - Write short doc-strings to associate the methods with situations they are used in or the procedure they follow
- Add error handling/logging to the actual sending of mails
- Refactor/Rephrase mails
- Dominant language
- Python
- Stars
- 0
- Forks
- 0
- Avg merge
- 29m
- Merged PRs (30d)
- 14
Getting set up
- Ships a Dockerfile or Docker Compose file
- No pull request template
- No contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from ClockGU/clockwork-backend
-
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
ClockGU/clockwork-backend#169 ·
Maintainers usually reply within 1 day
-
Difficulty 4/5 3-5 days Newbie friendliness 20/100
ClockGU/clockwork-backend#165 ·
Maintainers usually reply within 1 day
-
Difficulty 5/5 Over a week Newbie friendliness 20/100
ClockGU/clockwork-backend#164 ·
Maintainers usually reply within 1 day
-
Difficulty 5/5 Over a week Newbie friendliness 20/100
ClockGU/clockwork-backend#163 ·
Maintainers usually reply within 1 day
-
Difficulty 5/5 Over a week Newbie friendliness 25/100
ClockGU/clockwork-backend#162 ·
Maintainers usually reply within 1 day
All issues in ClockGU/clockwork-backend
Similar issues
-
DBFS append mode silently overwrites existing filesPossibly taken @IlyaKhalafi claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 77/100
fsspec/filesystem_spec#2429 ·
Maintainers usually reply within 1 day
-
[Bug]: Retrieval rerank fallback statistics stay zero after provider failurePossibly taken A pull request linked to this issue is open or already merged. Openbug
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
volcengine/OpenViking#7014 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
fedora-copr/copr#4600 ·
Maintainers usually reply within 2 days
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
ansys/pydpf-core#3620 ·
Maintainers usually reply within 1 day
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day