Skip to content

Commit 7c57734

Browse files
committed
Add subject parameter to send method
1 parent 286c217 commit 7c57734

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
44

55
[project]
66
name = "trysiren"
7-
version = "0.1.0"
7+
version = "0.1.1"
88
description = "Python SDK for the Siren Notification Platform."
99
readme = "README.md"
1010
requires-python = ">=3.8"

siren/clients/messaging.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ def send(
2323
channel: str,
2424
*,
2525
body: Optional[str] = None,
26+
subject: Optional[str] = None,
2627
template_name: Optional[str] = None,
2728
template_variables: Optional[Dict[str, Any]] = None,
2829
provider_name: Optional[str] = None,
@@ -34,6 +35,7 @@ def send(
3435
recipient_value: The identifier for the recipient (e.g., Slack user ID, email address)
3536
channel: The channel to send the message through (e.g., "SLACK", "EMAIL")
3637
body: Optional message body text (required if no template)
38+
subject: Optional subject for the message (required for channel type `EMAIL` with body)
3739
template_name: Optional template name (required if no body)
3840
template_variables: Optional template variables for template-based messages
3941
provider_name: Optional provider name (must be provided with provider_code)
@@ -61,6 +63,10 @@ def send(
6163

6264
if body is not None:
6365
payload["body"] = body
66+
67+
if subject is not None:
68+
payload["subject"] = subject
69+
6470
elif template_name is not None:
6571
payload["template"] = {"name": template_name}
6672
if template_variables is not None:

0 commit comments

Comments
 (0)