Skip to content

Commit 65b36b9

Browse files
committed
Docs
1 parent cf12228 commit 65b36b9

File tree

1 file changed

+24
-1
lines changed

1 file changed

+24
-1
lines changed

README.md

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -539,6 +539,7 @@ Send an event to trigger an email in Loops. [Read more about events](https://loo
539539
| `contact_properties` | object | No | An object containing contact properties, which will be updated or added to the contact when the event is received.<br />Please [add custom properties](https://loops.so/docs/contacts/properties#custom-contact-properties) in your Loops account before using them with the SDK.<br />Values can be of type `string`, `number`, `nil` (to reset a value), `boolean` or `date` ([see allowed date formats](https://loops.so/docs/contacts/properties#dates)). |
540540
| `event_properties` | object | No | An object containing event properties, which will be made available in emails that are triggered by this event.<br />Values can be of type `string`, `number`, `boolean` or `date` ([see allowed date formats](https://loops.so/docs/events/properties#important-information-about-event-properties)). |
541541
| `mailing_lists` | object | No | An object of mailing list IDs and boolean subscription statuses. |
542+
| `headers` | object | No | Additional headers to send with the request. |
542543

543544
#### Examples
544545

@@ -575,6 +576,15 @@ response = LoopsSdk::Events.send(
575576
plan: "pro",
576577
},
577578
)
579+
580+
# Example with Idempotency-Key header
581+
response = LoopsSdk::Events.send(
582+
event_name: "signup",
583+
email: "hello@gmail.com",
584+
headers: {
585+
"Idempotency-Key" => "550e8400-e29b-41d4-a716-446655440000"
586+
},
587+
)
578588
```
579589

580590
#### Response
@@ -608,12 +618,13 @@ Send a transactional email to a contact. [Learn about sending transactional emai
608618
| ---------------------------- | -------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
609619
| `transactional_id` | string | Yes | The ID of the transactional email to send. |
610620
| `email` | string | Yes | The email address of the recipient. |
611-
| `add_to_audience` | boolean | No | If `true`, a contact will be created in your audience using the `email` value (if a matching contact doesnt already exist). |
621+
| `add_to_audience` | boolean | No | If `true`, a contact will be created in your audience using the `email` value (if a matching contact doesn't already exist). |
612622
| `data_variables` | object | No | An object containing data as defined by the data variables added to the transactional email template.<br />Values can be of type `string` or `number`. |
613623
| `attachments` | object[] | No | A list of attachments objects.<br />**Please note**: Attachments need to be enabled on your account before using them with the API. [Read more](https://loops.so/docs/transactional/attachments) |
614624
| `attachments[].filename` | string | No | The name of the file, shown in email clients. |
615625
| `attachments[].content_type` | string | No | The MIME type of the file. |
616626
| `attachments[].data` | string | No | The base64-encoded content of the file. |
627+
| `headers` | object | No | Additional headers to send with the request. |
617628

618629
#### Examples
619630

@@ -626,6 +637,18 @@ response = LoopsSdk::Transactional.send(
626637
},
627638
)
628639

640+
# Example with Idempotency-Key header
641+
response = LoopsSdk::Transactional.send(
642+
transactional_id: "clfq6dinn000yl70fgwwyp82l",
643+
email: "hello@gmail.com",
644+
data_variables: {
645+
loginUrl: "https://myapp.com/login/",
646+
},
647+
headers: {
648+
"Idempotency-Key" => "550e8400-e29b-41d4-a716-446655440000"
649+
},
650+
)
651+
629652
# Please contact us to enable attachments on your account.
630653
response = LoopsSdk::Transactional.send(
631654
transactional_id: "clfq6dinn000yl70fgwwyp82l",

0 commit comments

Comments
 (0)