use resend_rs::{ types::{UpdateInboxDraftOptions}, Resend, Result,};#[tokio::main]async fn main() -> Result<()> { let resend = Resend::new("re_xxxxxxxxx"); let opts = UpdateInboxDraftOptions::new().with_subject("Refund issued for order 1041"); let _draft = resend .inboxes .update_draft( "b3e2b2b6-3f0e-4c8e-9ad3-2f43a1e2c7f1", "c3a1e8b4-2d5f-4a7c-9e10-6b8d7f5a4c32", opts, ) .await?; Ok(())}
import com.resend.Resend;import com.resend.core.exception.ResendException;import com.resend.services.inboxes.model.UpdateInboxDraftOptions;import com.resend.services.inboxes.model.UpdateInboxDraftResponseSuccess;public class Main { public static void main(String[] args) throws ResendException { Resend resend = new Resend("re_xxxxxxxxx"); UpdateInboxDraftOptions params = UpdateInboxDraftOptions.builder() .subject("Refund issued for order 1041") .build(); UpdateInboxDraftResponseSuccess data = resend.inboxes().drafts().update( "b3e2b2b6-3f0e-4c8e-9ad3-2f43a1e2c7f1", "c3a1e8b4-2d5f-4a7c-9e10-6b8d7f5a4c32", params); }}
using Resend;IResend resend = ResendClient.Create( "re_xxxxxxxxx" ); // Or from DIvar resp = await resend.InboxDraftUpdateAsync( new Guid( "b3e2b2b6-3f0e-4c8e-9ad3-2f43a1e2c7f1" ), new Guid( "c3a1e8b4-2d5f-4a7c-9e10-6b8d7f5a4c32" ), new InboxDraftUpdateData() { Subject = "Refund issued for order 1041", });Console.WriteLine( "Draft Id={0}", resp.Content );
Updates the content of an unsent draft. A draft that was already sent returns
a 409.
Path Parameters
Body Parameters
Send at least one field. Omitted fields keep their current value. A request
with html or text replaces both, and the one you leave out is saved as
null. After the update, the draft must still have at least one non-empty
field, and to, cc, and bcc combined cannot exceed 50 recipients.
string | string[] | null
Recipients. Send null or [] to clear them.
string | string[] | null
CC recipients. Send null or [] to clear them.
string | string[] | null
BCC recipients. Send null or [] to clear them.
string | null
The subject. 1 to 2000 characters, with no line breaks. Send null to clear
it.
string | null
The HTML body. Send null to clear it.
string | null
The plain-text body. Send null to clear it.
array | null
Files to store on the draft, up to 25 MB in total, downloaded files
included. All path downloads must finish within 20 seconds together.
Sending the field replaces every attachment on the draft. Send null or []
to remove them all. Drafts do not accept content_id.
Hide properties
buffer | string
Content of an attached file, passed as a buffer or Base64 string. Either
content or path must be provided.
string
Path where the attachment file is hosted. Resend downloads it when the
draft is saved, so a URL that cannot be downloaded returns an error. When
both content and path are sent, content is used.
string
required
Name of attached file.
Response Fields
string
Always inbox_draft.
string
The ID of the draft.
import { Resend } from 'resend';const resend = new Resend('re_xxxxxxxxx');const { data, error } = await resend.inboxes.drafts.update({ inboxId: 'b3e2b2b6-3f0e-4c8e-9ad3-2f43a1e2c7f1', draftId: 'c3a1e8b4-2d5f-4a7c-9e10-6b8d7f5a4c32', subject: 'Refund issued for order 1041',});
$resend = Resend::client('re_xxxxxxxxx');$resend->inboxes->drafts->update( 'b3e2b2b6-3f0e-4c8e-9ad3-2f43a1e2c7f1', 'c3a1e8b4-2d5f-4a7c-9e10-6b8d7f5a4c32', ['subject' => 'Refund issued for order 1041']);
import resendresend.api_key = "re_xxxxxxxxx"params: resend.Inboxes.Drafts.UpdateParams = { "inbox_id": "b3e2b2b6-3f0e-4c8e-9ad3-2f43a1e2c7f1", "id": "c3a1e8b4-2d5f-4a7c-9e10-6b8d7f5a4c32", "subject": "Refund issued for order 1041",}resend.Inboxes.Drafts.update(params)
require "resend"Resend.api_key = "re_xxxxxxxxx"params = { inbox_id: "b3e2b2b6-3f0e-4c8e-9ad3-2f43a1e2c7f1", draft_id: "c3a1e8b4-2d5f-4a7c-9e10-6b8d7f5a4c32", subject: "Refund issued for order 1041"}Resend::Inboxes::Drafts.update(params)
use resend_rs::{ types::{UpdateInboxDraftOptions}, Resend, Result,};#[tokio::main]async fn main() -> Result<()> { let resend = Resend::new("re_xxxxxxxxx"); let opts = UpdateInboxDraftOptions::new().with_subject("Refund issued for order 1041"); let _draft = resend .inboxes .update_draft( "b3e2b2b6-3f0e-4c8e-9ad3-2f43a1e2c7f1", "c3a1e8b4-2d5f-4a7c-9e10-6b8d7f5a4c32", opts, ) .await?; Ok(())}
import com.resend.Resend;import com.resend.core.exception.ResendException;import com.resend.services.inboxes.model.UpdateInboxDraftOptions;import com.resend.services.inboxes.model.UpdateInboxDraftResponseSuccess;public class Main { public static void main(String[] args) throws ResendException { Resend resend = new Resend("re_xxxxxxxxx"); UpdateInboxDraftOptions params = UpdateInboxDraftOptions.builder() .subject("Refund issued for order 1041") .build(); UpdateInboxDraftResponseSuccess data = resend.inboxes().drafts().update( "b3e2b2b6-3f0e-4c8e-9ad3-2f43a1e2c7f1", "c3a1e8b4-2d5f-4a7c-9e10-6b8d7f5a4c32", params); }}
using Resend;IResend resend = ResendClient.Create( "re_xxxxxxxxx" ); // Or from DIvar resp = await resend.InboxDraftUpdateAsync( new Guid( "b3e2b2b6-3f0e-4c8e-9ad3-2f43a1e2c7f1" ), new Guid( "c3a1e8b4-2d5f-4a7c-9e10-6b8d7f5a4c32" ), new InboxDraftUpdateData() { Subject = "Refund issued for order 1041", });Console.WriteLine( "Draft Id={0}", resp.Content );
use resend_rs::{ types::{UpdateInboxDraftOptions}, Resend, Result,};#[tokio::main]async fn main() -> Result<()> { let resend = Resend::new("re_xxxxxxxxx"); let opts = UpdateInboxDraftOptions::new().with_subject("Refund issued for order 1041"); let _draft = resend .inboxes .update_draft( "b3e2b2b6-3f0e-4c8e-9ad3-2f43a1e2c7f1", "c3a1e8b4-2d5f-4a7c-9e10-6b8d7f5a4c32", opts, ) .await?; Ok(())}
import com.resend.Resend;import com.resend.core.exception.ResendException;import com.resend.services.inboxes.model.UpdateInboxDraftOptions;import com.resend.services.inboxes.model.UpdateInboxDraftResponseSuccess;public class Main { public static void main(String[] args) throws ResendException { Resend resend = new Resend("re_xxxxxxxxx"); UpdateInboxDraftOptions params = UpdateInboxDraftOptions.builder() .subject("Refund issued for order 1041") .build(); UpdateInboxDraftResponseSuccess data = resend.inboxes().drafts().update( "b3e2b2b6-3f0e-4c8e-9ad3-2f43a1e2c7f1", "c3a1e8b4-2d5f-4a7c-9e10-6b8d7f5a4c32", params); }}
using Resend;IResend resend = ResendClient.Create( "re_xxxxxxxxx" ); // Or from DIvar resp = await resend.InboxDraftUpdateAsync( new Guid( "b3e2b2b6-3f0e-4c8e-9ad3-2f43a1e2c7f1" ), new Guid( "c3a1e8b4-2d5f-4a7c-9e10-6b8d7f5a4c32" ), new InboxDraftUpdateData() { Subject = "Refund issued for order 1041", });Console.WriteLine( "Draft Id={0}", resp.Content );