NUKnightLab / NUKnightLab/weatherbot

Email templates are in HTML, but are not sent as HTML

Open
#4 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
7
Forks
4
PR merge metrics
No merged PRs in 30d

Description

The various email templates are in HTML files, but when they are sent, they are not sent in a way which that signals a receiving client to render them as HTML. There's also some code that pulls text out of <p> tags, which kind of undoes the HTML. See https://github.com/NUKnightLab/weatherbot/blob/54eefc2b1cc180aef13f2e160a2201a4ec3dbc2b/NHC.py#L322-L324

(I also wonder if the <ul> content of some email templates comes through that process looking as we'd like it to.)

We could change the templates to be plain text, although formatting lists in ASCII is a pain; or we could use more advanced methods of the python email.message library to send the email as HTML, which is a different kind of a pain.

But if we are sending the messages as text, we should use text templates, and not HTML templates with a custom process for reducing the templates to plain text.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with NHC.py at lines 322-324 and review how the HTML templates are converted before being sent. Read the Python email.message documentation to compare the available plain-text and HTML approaches. Done means the chosen message format is signaled correctly to receiving clients and list content renders or reads as intended.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
backend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.