Refactor - Mail sending and EmailHandler

オープン
#176 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

@chgad がすでに取り組んでいます。

2026年11月2日 から。

  • #177 @chgad による — オープン

評価

難易度
3/5
見積もり時間
1〜2日
初心者へのやさしさ
45/100
issue の種類
リファクタリング
明瞭さ
おおむね明確
活発さ
活発
技術スタック
python
領域
backend

調査の方向性

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.

索引モデルが issue の本文から書いたものです。

説明

EmailHandler specific:
__init__():

  • Remove self.environment as 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 the self.server attribute. Then get_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.py file dedicated to store capitalized variables to store Mail body and subject strings
  • Move mail strings from the send_*() methods to the new mail_templates.py
  • Move Subject strings from the send_*() methods to the new mail_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
主要言語
Python
スター
0
フォーク
0
平均マージ
29分
マージ済み PR(30日)
14

環境構築

  • Dockerfile または Docker Compose ファイルあり
  • プルリクエストのテンプレートなし
  • コントリビューションガイドなし

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

ClockGU/clockwork-backend のほかの issue

ClockGU/clockwork-backend の issue をすべて見る

似ている issue

Python の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。