Skip to content

transactional_send

TransactionalSendMessageRequest

Bases: TypedDict

Request body for POST /v3/domains/{domain_name}/messages/send.

Use from_ for the sender; it is serialized as JSON from (from is a Python keyword).

Attributes:

Name Type Description
to Required[List[EmailName]]

Recipients (required by the API).

from_ Required[EmailName]

Sender email / optional name (required by the API).

subject NotRequired[str]

Subject line.

body NotRequired[str]

HTML or plain body depending on is_plaintext.

cc NotRequired[List[EmailName]]

CC recipients.

bcc NotRequired[List[EmailName]]

BCC recipients.

reply_to NotRequired[List[EmailName]]

Reply-To recipients.

attachments NotRequired[List[CreateAttachmentRequest]]

File attachments.

send_at NotRequired[int]

Unix timestamp to send the message later.

reply_to_message_id NotRequired[str]

Message being replied to.

tracking_options NotRequired[TrackingOptions]

Open/link tracking settings.

custom_headers NotRequired[List[CustomHeader]]

Custom MIME headers.

metadata NotRequired[Dict[str, Any]]

String-keyed metadata.

is_plaintext NotRequired[bool]

Send body as plain text when true.

template NotRequired[TransactionalTemplate]

Application template to render (optional vs. body/subject).

Source code in nylas/models/transactional_send.py
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
class TransactionalSendMessageRequest(TypedDict, total=False):
    """
    Request body for POST /v3/domains/{domain_name}/messages/send.

    Use ``from_`` for the sender; it is serialized as JSON ``from`` (``from`` is a Python keyword).

    Attributes:
        to: Recipients (required by the API).
        from_: Sender ``email`` / optional ``name`` (required by the API).
        subject: Subject line.
        body: HTML or plain body depending on ``is_plaintext``.
        cc: CC recipients.
        bcc: BCC recipients.
        reply_to: Reply-To recipients.
        attachments: File attachments.
        send_at: Unix timestamp to send the message later.
        reply_to_message_id: Message being replied to.
        tracking_options: Open/link tracking settings.
        custom_headers: Custom MIME headers.
        metadata: String-keyed metadata.
        is_plaintext: Send body as plain text when true.
        template: Application template to render (optional vs. body/subject).
    """

    to: Required[List[EmailName]]
    from_: Required[EmailName]
    subject: NotRequired[str]
    body: NotRequired[str]
    cc: NotRequired[List[EmailName]]
    bcc: NotRequired[List[EmailName]]
    reply_to: NotRequired[List[EmailName]]
    attachments: NotRequired[List[CreateAttachmentRequest]]
    send_at: NotRequired[int]
    reply_to_message_id: NotRequired[str]
    tracking_options: NotRequired[TrackingOptions]
    custom_headers: NotRequired[List[CustomHeader]]
    metadata: NotRequired[Dict[str, Any]]
    is_plaintext: NotRequired[bool]
    template: NotRequired[TransactionalTemplate]

TransactionalTemplate

Bases: TypedDict

Template selection for a transactional send request.

Attributes:

Name Type Description
id Required[str]

The template ID.

strict NotRequired[bool]

When true, Nylas returns an error if the template contains undefined variables.

variables NotRequired[Dict[str, Any]]

Key/value pairs substituted into the template.

Source code in nylas/models/transactional_send.py
10
11
12
13
14
15
16
17
18
19
20
21
22
class TransactionalTemplate(TypedDict, total=False):
    """
    Template selection for a transactional send request.

    Attributes:
        id: The template ID.
        strict: When true, Nylas returns an error if the template contains undefined variables.
        variables: Key/value pairs substituted into the template.
    """

    id: Required[str]
    strict: NotRequired[bool]
    variables: NotRequired[Dict[str, Any]]