Skip to content

Commit

Permalink
Docs for new email endpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
m-tabaza committed Jul 10, 2024
1 parent 11c62d5 commit c8be5d0
Showing 1 changed file with 50 additions and 9 deletions.
59 changes: 50 additions & 9 deletions docs/email/email_api.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -22,34 +22,75 @@ description: "Send emails to your contacts, possibly after a specified time dela
Otherwise, the request will fail with a 400 status code.
</ParamField>

<ParamField body="recipients" type="array" required>

Array of contacts to receive emails. The only required field is `to_email`, with the rest of the fields having fallback values that can be specified on the top level.

It's possible to repeat the same contact email in the array with different `delay_in_minutes` values to create a sequence of scheduled emails for that contact (e.g. for onboarding).

<Expandable title="recipients">
<ParamField body="to_email" type="string" required>
The email to send to.
</ParamField>

<ParamField body="email_subject" type="string" required>
{" "}

<ParamField body="email_subject" type="string">
Subject of the email.
</ParamField>

<ParamField body="email_body" type="string" required>
{" "}

<ParamField body="email_body" type="string">
Body of the email in HTML format.
</ParamField>

{" "}

<ParamField body="email_sender_name" type="string">
Display name of the email sender.
</ParamField>

<ParamField body="delay_in_minutes" type="string">
How much time (in minutes) to wait before sending the email.
<ParamField body="delay_in_minutes" type="string">
How much time (in minutes) to wait before sending the email.
</ParamField>
</Expandable>
</ParamField>

<ParamField body="fallback_email_subject" type="string">
Subject of the email in case none is provided for the contact within the
`recipients` array.
</ParamField>

<ParamField body="fallback_email_body" type="string">
Body of the email in HTML format in case none is provided for the contact
within the `recipients` array.
</ParamField>

<ParamField body="fallback_email_sender_name" type="string">
Display name of the email sender in case none is provided for the contact
within the `recipients` array.
</ParamField>

### Body Example

```json
{
"from_email": "[email protected]",
"to_email": "[email protected]",
"email_subject": "Hello!",
"email_body": "<h1>Thanks for signing up!</h1>",
"delay_in_minutes": 30
"from_email": "[email protected]",
"recipients": [
{
"to_email": "[email protected]",
"email_body": "BODY",
"email_subject": "SUBJECT",
"email_sender_name": "SENDER NAME",
"delay_in_minutes": 2
},
{
"to_email": "[email protected]"
}
],
"fallback_email_subject": "FALLBACK SUBJECT",
"fallback_email_sender_name": "FALLBACK SENDER NAME",
"fallback_email_body": "FALLBACK BODY"
}
```

0 comments on commit c8be5d0

Please sign in to comment.