paper_firehose.processors.emailer

Email rendering and sending utilities for Paper Firehose.

Generates a simple, email-friendly HTML digest from papers.db and sends it via SMTP (SSL) based on configuration stored in the runtime data directory (config/config.yaml under the path resolved by PAPER_FIREHOSE_DATA_DIR).

Uses only the Python standard library.

Classes

EmailRenderer()

Create compact HTML suitable for email clients (no external JS/CSS).

SMTPSender(smtp_cfg[, config_dir])

Send emails via SMTP (SSL) using settings under config['email']['smtp'].

class paper_firehose.processors.emailer.EmailRenderer[source]

Bases: object

Create compact HTML suitable for email clients (no external JS/CSS).

render_full_email(title, sections)[source]

Return a complete HTML email with a title and named sections.

sections: list of (section_title, section_html)

Return type:

str

Parameters:
render_ranked_entries(topic_display_name, entries, *, max_items=None)[source]

Render a ranked-style section for email with minimal, inline CSS.

Entry layout: - Title (link) with Score badge - Authors - Feed name - Abstract if present; otherwise summary if available

Return type:

str

Parameters:
render_topic_digest(topic_display_name, entries, *, max_items=None)[source]

Return HTML body for a single topic.

Entries expected to contain keys: title, link, authors, published_date, feed_name, abstract, summary, rank_score.

Return type:

str

Parameters:
class paper_firehose.processors.emailer.SMTPSender(smtp_cfg, config_dir=None)[source]

Bases: object

Send emails via SMTP (SSL) using settings under config[‘email’][‘smtp’].

Parameters:
  • smtp_cfg (Dict[str, Any])

  • config_dir (Optional[str])

send(*, subject, from_addr, to_addrs, html_body, text_body=None)[source]

Send a multipart email with HTML alternative using SMTP over SSL.

Return type:

None

Parameters: