notify
Unified notification dispatcher for Snowpark Stored Procedures.
Routes a single notify() call to one or more channels:
Email (via SYSTEM$SEND_EMAIL), Microsoft Teams Adaptive Cards,
or Slack block messages.
All requests imports are lazy — the module is importable without
requests installed.
Channel
Bases: str, Enum
Supported notification channels.
Source code in src/pinky_connect/notify.py
20 21 22 23 24 25 | |
NotifyI18n
Bases: BaseModel
Built-in per-language labels. Pass a custom instance to notify() to override.
Attributes:
| Name | Type | Description |
|---|---|---|
fr |
NotifyLabels
|
French labels (default). |
en |
NotifyLabels
|
English labels. |
Source code in src/pinky_connect/notify.py
38 39 40 41 42 43 44 45 46 47 | |
NotifyLabels
Bases: BaseModel
Label set for one language used in notification templates.
Attributes:
| Name | Type | Description |
|---|---|---|
subject_prefix |
str
|
Bracketed prefix prepended to the email subject line. |
Source code in src/pinky_connect/notify.py
28 29 30 31 32 33 34 35 | |
NotifyResult
Bases: BaseModel
Result returned by :func:notify.
Attributes:
| Name | Type | Description |
|---|---|---|
channel |
Channel
|
The channel that was used. |
success |
bool
|
Whether the notification was delivered without error. |
status_code |
int | None
|
HTTP status code from the downstream API, if applicable. |
error |
str | None
|
Error message if success is |
Source code in src/pinky_connect/notify.py
50 51 52 53 54 55 56 57 58 59 60 61 62 63 | |
generate_html(subject, body, *, i18n=None, lang='fr')
Render a branded HTML email body.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
subject
|
str
|
Email subject line, used as the H1 heading. |
required |
body
|
str
|
Plain-text or Markdown content rendered inside the email. |
required |
i18n
|
NotifyI18n | None
|
Label overrides. Defaults to :class: |
None
|
lang
|
str
|
ISO-639-1 language code selecting the active :class: |
'fr'
|
Returns:
| Type | Description |
|---|---|
str
|
A self-contained HTML string suitable for |
Source code in src/pinky_connect/notify.py
66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 | |
notify(channel, *, subject, body, recipients=None, webhook_url=None, i18n=None, lang='fr', **extra)
Send a notification to the specified channel.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
channel
|
Channel | str
|
Target channel — |
required |
subject
|
str
|
Notification title / subject line. |
required |
body
|
str
|
Main message content. |
required |
recipients
|
list[str] | None
|
Email addresses (required when channel is |
None
|
webhook_url
|
str | None
|
Incoming webhook URL (required for |
None
|
i18n
|
NotifyI18n | None
|
Label overrides. Defaults to :class: |
None
|
lang
|
str
|
ISO-639-1 language code selecting the active :class: |
'fr'
|
**extra
|
Any
|
Channel-specific overrides forwarded to the underlying sender. |
{}
|
Returns:
| Name | Type | Description |
|---|---|---|
A |
NotifyResult
|
class: |
Source code in src/pinky_connect/notify.py
87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 | |