Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion products/messaging/backend/services/transactional_email.py
Original file line number Diff line number Diff line change
Expand Up @@ -527,7 +527,12 @@ def _code_send_sender(team_id: int, address: str | None) -> dict[str, Any]:
if address:
raise NamedSenderNotVerified(f"No verified sender in this project can send from `{email}`.") from e
raise SenderNotVerified("The project has no verified default email sender.") from e
return {"integrationId": sender.integration_id, "email": sender.email, "name": sender.name}
return {
"integrationId": sender.integration_id,
"email": sender.email,
"name": sender.name,
"isDefault": not address,
}


def _without_empty(fields: dict[str, Any]) -> dict[str, Any]:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -428,7 +428,7 @@ def test_a_code_send_goes_out_as_is_under_the_keys_workflow(
"variables": {},
"send": {
"content": {"subject": "Welcome, Jane", "html": "<p>Hi Jane</p>", "text": "Hi Jane"},
"from": {"integrationId": self.sender.id},
"from": {"integrationId": self.sender.id, "isDefault": True},
"tracking": {"captureEngagement": True},
},
}
Expand Down Expand Up @@ -471,13 +471,18 @@ def test_a_code_send_makes_a_new_workflow_when_its_keys_workflow_was_deleted(sel
{"capture_engagement": False},
{
"content": {"subject": "Welcome, Jane", "html": "<p>Hi Jane</p>", "text": "Hi Jane"},
"from": {"isDefault": True},
"tracking": {"captureEngagement": False},
},
),
(
"text_only",
{"html": "", "text": "Hi"},
{"content": {"subject": "Welcome, Jane", "text": "Hi"}, "tracking": {"captureEngagement": True}},
{
"content": {"subject": "Welcome, Jane", "text": "Hi"},
"from": {"isDefault": True},
"tracking": {"captureEngagement": True},
},
),
]
)
Expand Down
Loading