import { Resend } from 'resend';
const resend = new Resend('re_xxxxxxxxx');
// Update by contact id
const { data, error } = await resend.contacts.update({
id: 'e169aa45-1ecf-4183-9955-b1499d5701d3',
unsubscribed: true,
});
// Update by contact email
const { data, error } = await resend.contacts.update({
email: '[email protected]',
unsubscribed: true,
});
{
"object": "contact",
"id": "479e3145-dd38-476b-932c-529ceb705947"
}
Update an existing contact.
import { Resend } from 'resend';
const resend = new Resend('re_xxxxxxxxx');
// Update by contact id
const { data, error } = await resend.contacts.update({
id: 'e169aa45-1ecf-4183-9955-b1499d5701d3',
unsubscribed: true,
});
// Update by contact email
const { data, error } = await resend.contacts.update({
email: '[email protected]',
unsubscribed: true,
});
{
"object": "contact",
"id": "479e3145-dd38-476b-932c-529ceb705947"
}
id or email must be provided.
true, the contact will
be unsubscribed from all Broadcasts.import { Resend } from 'resend';
const resend = new Resend('re_xxxxxxxxx');
// Update by contact id
const { data, error } = await resend.contacts.update({
id: 'e169aa45-1ecf-4183-9955-b1499d5701d3',
unsubscribed: true,
});
// Update by contact email
const { data, error } = await resend.contacts.update({
email: '[email protected]',
unsubscribed: true,
});
{
"object": "contact",
"id": "479e3145-dd38-476b-932c-529ceb705947"
}
Was this page helpful?