Update docs for adding contacts programatically
This commit is contained in:
@@ -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
|
||||
|
@@ -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>
|
||||
|
Reference in New Issue
Block a user