use resend_rs::{ types::UpdateTemplateOptions, Resend, Result,};#[tokio::main]async fn main() -> Result<()> { let resend = Resend::new("re_xxxxxxxxx"); let name = "order-confirmation"; let html = "<p>Total: {{{PRICE}}}</p><p>Name: {{{PRODUCT}}}</p>"; let update = UpdateTemplateOptions::new(name, html); let _template = resend .templates .update("34a080c9-b17d-4187-ad80-5af20266e535", update) .await?; Ok(())}
import com.resend.Resend;import com.resend.core.exception.ResendException;import com.resend.services.templates.model.UpdateTemplateOptions;import com.resend.services.templates.model.UpdateTemplateResponseSuccess;public class Main { public static void main(String[] args) throws ResendException { Resend resend = new Resend("re_xxxxxxxxx"); UpdateTemplateOptions params = UpdateTemplateOptions.builder() .name("order-confirmation") .html("<p>Total: {{{PRICE}}}</p><p>Name: {{{PRODUCT}}}</p>") .build(); UpdateTemplateResponseSuccess data = resend.templates().update("34a080c9-b17d-4187-ad80-5af20266e535", params); }}
using Resend;IResend resend = ResendClient.Create( "re_xxxxxxxxx" ); // Or from DIawait resend.TemplateUpdateAsync( templateId: new Guid( "e169aa45-1ecf-4183-9955-b1499d5701d3" ), new TemplateData() { HtmlBody = "<p>Total: {{{PRICE}}}</p><p>Name: {{{PRODUCT}}}</p>", });
use resend_rs::{ types::UpdateTemplateOptions, Resend, Result,};#[tokio::main]async fn main() -> Result<()> { let resend = Resend::new("re_xxxxxxxxx"); let name = "order-confirmation"; let html = "<p>Total: {{{PRICE}}}</p><p>Name: {{{PRODUCT}}}</p>"; let update = UpdateTemplateOptions::new(name, html); let _template = resend .templates .update("34a080c9-b17d-4187-ad80-5af20266e535", update) .await?; Ok(())}
import com.resend.Resend;import com.resend.core.exception.ResendException;import com.resend.services.templates.model.UpdateTemplateOptions;import com.resend.services.templates.model.UpdateTemplateResponseSuccess;public class Main { public static void main(String[] args) throws ResendException { Resend resend = new Resend("re_xxxxxxxxx"); UpdateTemplateOptions params = UpdateTemplateOptions.builder() .name("order-confirmation") .html("<p>Total: {{{PRICE}}}</p><p>Name: {{{PRODUCT}}}</p>") .build(); UpdateTemplateResponseSuccess data = resend.templates().update("34a080c9-b17d-4187-ad80-5af20266e535", params); }}
using Resend;IResend resend = ResendClient.Create( "re_xxxxxxxxx" ); // Or from DIawait resend.TemplateUpdateAsync( templateId: new Guid( "e169aa45-1ecf-4183-9955-b1499d5701d3" ), new TemplateData() { HtmlBody = "<p>Total: {{{PRICE}}}</p><p>Name: {{{PRODUCT}}}</p>", });
Sender email address.To include a friendly name, use the format "Your Name <sender@domain.com>".If provided, this value can be overridden when sending an email using the template.
The key of the variable. We recommend capitalizing the key (e.g. PRODUCT_NAME). The following variable names are reserved and cannot be used:
FIRST_NAME, LAST_NAME, EMAIL, RESEND_UNSUBSCRIBE_URL, contact, and this.
use resend_rs::{ types::UpdateTemplateOptions, Resend, Result,};#[tokio::main]async fn main() -> Result<()> { let resend = Resend::new("re_xxxxxxxxx"); let name = "order-confirmation"; let html = "<p>Total: {{{PRICE}}}</p><p>Name: {{{PRODUCT}}}</p>"; let update = UpdateTemplateOptions::new(name, html); let _template = resend .templates .update("34a080c9-b17d-4187-ad80-5af20266e535", update) .await?; Ok(())}
import com.resend.Resend;import com.resend.core.exception.ResendException;import com.resend.services.templates.model.UpdateTemplateOptions;import com.resend.services.templates.model.UpdateTemplateResponseSuccess;public class Main { public static void main(String[] args) throws ResendException { Resend resend = new Resend("re_xxxxxxxxx"); UpdateTemplateOptions params = UpdateTemplateOptions.builder() .name("order-confirmation") .html("<p>Total: {{{PRICE}}}</p><p>Name: {{{PRODUCT}}}</p>") .build(); UpdateTemplateResponseSuccess data = resend.templates().update("34a080c9-b17d-4187-ad80-5af20266e535", params); }}
using Resend;IResend resend = ResendClient.Create( "re_xxxxxxxxx" ); // Or from DIawait resend.TemplateUpdateAsync( templateId: new Guid( "e169aa45-1ecf-4183-9955-b1499d5701d3" ), new TemplateData() { HtmlBody = "<p>Total: {{{PRICE}}}</p><p>Name: {{{PRODUCT}}}</p>", });