Update docs for adding contacts programatically

This commit is contained in:
KMKoushik
2024-08-11 16:32:12 +10:00
parent a554803598
commit 6624160654
2 changed files with 30 additions and 1 deletions

View File

@@ -41,7 +41,7 @@ We are currently in beta and trying to rollout to public slowly. If you're inter
- [x] Transactional Mails
- [x] Rest API
- [x] Dashboard (Delivered, opened, clicked, bounced)
- [ ] Marketing email
- [x] Marketing email
- [ ] Webhook support
- [ ] SMTP support
- [ ] BYO AWS credentials

View File

@@ -54,3 +54,32 @@ icon: node-js
```
</Step>
</Steps>
## Adding contacts programatically
<Steps>
<Step title="Get the contact book id">
Get the contact book id from the [Unsend dashboard](https://app.unsend.dev/contacts/). Copy the contact book id
</Step>
<Step title="Add contacts">
```javascript
unsend.contacts
.create("clzeydgeygff", {
email: "hey@koushik.dev",
firstName: "Koushik",
lastName: "KM",
})
```
</Step>
<Step title="Update contact">
```javascript
unsend.contacts.update("clzeydgeygff", contactId, {
firstName: "Koushik",
lastName: "KM",
});
```
</Step>
</Steps>