Skip to content

bolig_ping.email

source module bolig_ping.email

Sending emails with home listings.

Functions

source compose_email(homes: list[Home]) → tuple[str, str]

Compose an email with the given homes.

Parameters

  • homes : list[Home] — The homes to compose the email with.

Returns

  • tuple[str, str] — A pair (subject, contents) for the email.

Raises

  • ValueError

source send_emails(from_email: str, password: str, to_emails: list[str], subject: str, contents: str) → None

Send an email with the given contents.

Parameters

  • from_email : str — The email to send the email from.

  • password : str — The password for the from email.

  • to_emails : list[str] — The emails to send the email to.

  • subject : str — The subject of the email.

  • contents : str — The contents of the email.