fenn.notification.services

class fenn.notification.services.Discord(webhook_url)[source]

Bases: Service

Discord notification service using webhooks.

Parameters:

webhook_url (str)

__init__(webhook_url)[source]

Initialize Discord service.

Parameters:

webhook_url (str)

send_notification(message)[source]

Send notification to Discord channel.

Parameters:

message (str) – The message to send.

Raises:

requests.exceptions.RequestException – If the request fails.

Return type:

None

class fenn.notification.services.Resend(api_key, from_email, to_emails_raw, subject='Notification from fenn')[source]

Bases: Service

Resend email notification service.

Parameters:
  • api_key (str)

  • from_email (str)

  • to_emails_raw (str)

  • subject (str)

__init__(api_key, from_email, to_emails_raw, subject='Notification from fenn')[source]

Initialize Resend service.

Parameters:
  • subject (str) – Email subject line. Defaults to “Notification from fenn”.

  • api_key (str)

  • from_email (str)

  • to_emails_raw (str)

Raises:

KeyError – If required configuration is missing.

send_notification(message)[source]

Send email notification to all configured recipients.

Parameters:

message (str) – The message to send as email body.

Raises:

Exception – If the email fails to send.

Return type:

None

class fenn.notification.services.Slack(webhook_url)[source]

Bases: Service

Slack notification service using webhooks.

Parameters:

webhook_url (str)

__init__(webhook_url)[source]

Initialize Slack service.

Parameters:

webhook_url (str)

send_notification(message)[source]

Send notification to Slack channel.

Parameters:

message (str) – The message to send.

Raises:

requests.exceptions.RequestException – If the request fails.

Return type:

None

class fenn.notification.services.Telegram(bot_token, chat_id, parse_mode=None)[source]

Bases: Service

Telegram notification service using webhooks.

Parameters:
  • bot_token (str)

  • chat_id (str)

  • parse_mode (Literal['Markdown', 'HTML'] | None)

__init__(bot_token, chat_id, parse_mode=None)[source]

Initialize Telegram service.

Parameters:
  • bot_token (str) – Telegram bot token. If None, reads from TELEGRAM_BOT_TOKEN env var.

  • chat_id (str) – Telegram chat ID. If None, reads from TELEGRAM_CHAT_ID env var.

  • parse_mode (Literal['Markdown', 'HTML'] | None)

Raises:

ValueError – If webhook URL is not provided or found in environment.

send_notification(message)[source]

Send notification to Telegram chat.

Parameters:

message (str) – The message to send.

Raises:

requests.exceptions.RequestException – If the request fails.

Return type:

None