it works!
', }, ]); ``` ```php PHP $resend = Resend::client('re_xxxxxxxxx'); $resend->batch->send([ [ 'from' => 'Acmeit works!
', ] ]); ``` ```py Python import resend from typing import List resend.api_key = "re_xxxxxxxxx" params: List[resend.Emails.SendParams] = [ { "from": "Acmeit works!
", } ] resend.Batch.send(params) ``` ```rb Ruby require "resend" Resend.api_key = 're_xxxxxxxxx' params = [ { "from": "Acmeit works!
", } ] Resend::Batch.send(params) ``` ```go Go package examples import ( "fmt" "os" "github.com/resend/resend-go/v2" ) func main() { ctx := context.TODO() client := resend.NewClient("re_xxxxxxxxx") var batchEmails = []*resend.SendEmailRequest{ { From: "Acmeit works!
", }, } sent, err := client.Batch.SendWithContext(ctx, batchEmails) if err != nil { panic(err) } fmt.Println(sent.Data) } ``` ```rust Rust use resend_rs::types::CreateEmailBaseOptions; use resend_rs::{Resend, Result}; #[tokio::main] async fn main() -> Result<()> { let resend = Resend::new("re_xxxxxxxxx"); let emails = vec![ CreateEmailBaseOptions::new( "Acmeit works!
"), ]; let _emails = resend.batch.send(emails).await?; Ok(()) } ``` ```java Java import com.resend.*; public class Main { public static void main(String[] args) { Resend resend = new Resend("re_xxxxxxxxx"); CreateEmailOptions firstEmail = CreateEmailOptions.builder() .from("Acmeit works!
") .build(); CreateBatchEmailsResponse data = resend.batch().send( Arrays.asList(firstEmail, secondEmail) ); } } ``` ```csharp .NET using Resend; IResend resend = ResendClient.Create( "re_xxxxxxxxx" ); // Or from DI var mail1 = new EmailMessage() { From = "Acmeit works!
", }; var mail2 = new EmailMessage() { From = "Acmeit works!
", }; var resp = await resend.EmailBatchAsync( [ mail1, mail2 ] ); Console.WriteLine( "Nr Emails={0}", resp.Content.Count ); ``` ```bash cURL curl -X POST 'https://api.resend.com/emails/batch' \ -H 'Authorization: Bearer re_xxxxxxxxx' \ -H 'Content-Type: application/json' \ -d $'[ { "from": "Acmeit works!
" } ]' ```it works!
', replyTo: 'onboarding@resend.dev', }); ``` ```php PHP $resend = Resend::client('re_xxxxxxxxx'); $resend->emails->send([ 'from' => 'Acmeit works!
', 'reply_to': 'onboarding@resend.dev' ]); ``` ```python Python import resend resend.api_key = "re_xxxxxxxxx" params: resend.Emails.SendParams = { "from": "Acmeit works!
", "reply_to": "onboarding@resend.dev" } email = resend.Emails.send(params) print(email) ``` ```rb Ruby require "resend" Resend.api_key = "re_xxxxxxxxx" params = { "from": "Acmeit works!
", "reply_to": "onboarding@resend.dev" } sent = Resend::Emails.send(params) puts sent ``` ```go Go import ( "fmt" "github.com/resend/resend-go/v2" ) func main() { ctx := context.TODO() client := resend.NewClient("re_xxxxxxxxx") params := &resend.SendEmailRequest{ From: "Acmeit works!
", ReplyTo: "onboarding@resend.dev" } sent, err := client.Emails.SendWithContext(ctx, params) if err != nil { panic(err) } fmt.Println(sent.Id) } ``` ```rust Rust use resend_rs::types::{CreateEmailBaseOptions}; use resend_rs::{Resend, Result}; #[tokio::main] async fn main() -> Result<()> { let resend = Resend::new("re_xxxxxxxxx"); let from = "Acmeit works!
"; let reply_to = "onboarding@resend.dev"; let email = CreateEmailBaseOptions::new(from, to, subject) .with_html(html); let _email = resend.emails.send(email).await?; Ok(()) } ``` ```java Java import com.resend.*; public class Main { public static void main(String[] args) { Resend resend = new Resend("re_xxxxxxxxx"); CreateEmailOptions params = CreateEmailOptions.builder() .from("Acmeit works!
") .replyTo("onboarding@resend.dev") .build(); CreateEmailResponse data = resend.emails().send(params); } } ``` ```csharp .NET using Resend; IResend resend = ResendClient.Create( "re_xxxxxxxxx" ); // Or from DI var resp = await resend.EmailSendAsync( new EmailMessage() { From = "Acmeit works!
", ReplyTo = "onboarding@resend.dev", } ); Console.WriteLine( "Email Id={0}", resp.Content ); ``` ```bash cURL curl -X POST 'https://api.resend.com/emails' \ -H 'Authorization: Bearer re_xxxxxxxxx' \ -H 'Content-Type: application/json' \ -d $'{ "from": "Acmeit works!
", "reply_to": "onboarding@resend.dev" }' ```Thanks for the payment
', attachments: [ { path: 'https://resend.com/static/sample/invoice.pdf', filename: 'invoice.pdf', }, ], }); ``` ```php PHP {10-11} $resend = Resend::client('re_xxxxxxxxx'); $resend->emails->send([ 'from' => 'AcmeThanks for the payment
', 'attachments' => [ [ 'path' => 'https://resend.com/static/sample/invoice.pdf', 'filename' => 'invoice.pdf' ] ] ]); ``` ```python Python {6-7} import resend resend.api_key = "re_xxxxxxxxx" attachment: resend.RemoteAttachment = { "path": "https://resend.com/static/sample/invoice.pdf", "filename": "invoice.pdf", } params: resend.Emails.SendParams = { "from": "AcmeThanks for the payment
", "attachments": [attachment], } resend.Emails.send(params) ``` ```rb Ruby {12-13} require "resend" Resend.api_key = "re_xxxxxxxxx" params = { "from": "AcmeThanks for the payment
", "attachments": [ { "path": "https://resend.com/static/sample/invoice.pdf", "filename": 'invoice.pdf', } ] } Resend::Emails.send(params) ``` ```go Go {12-13} import ( "fmt" "github.com/resend/resend-go/v2" ) func main() { ctx := context.TODO() client := resend.NewClient("re_xxxxxxxxx") attachment := &resend.Attachment{ Path: "https://resend.com/static/sample/invoice.pdf", Filename: "invoice.pdf", } params := &resend.SendEmailRequest{ From: "AcmeThanks for the payment
", Attachments: []*resend.Attachment{attachment}, } sent, err := client.Emails.SendWithContext(ctx, params) if err != nil { panic(err) } fmt.Println(sent.Id) } ``` ```rust Rust {12-13} use resend_rs::types::{Attachment, CreateEmailBaseOptions}; use resend_rs::{Resend, Result}; #[tokio::main] async fn main() -> Result<()> { let resend = Resend::new("re_xxxxxxxxx"); let from = "AcmeThanks for the payment
") .with_attachment(Attachment::from_path(path).with_filename(filename)); let _email = resend.emails.send(email).await?; Ok(()) } ``` ```java Java {8-9} import com.resend.*; public class Main { public static void main(String[] args) { Resend resend = new Resend("re_xxxxxxxxx"); Attachment att = Attachment.builder() .path("https://resend.com/static/sample/invoice.pdf") .fileName("invoice.pdf") .build(); CreateEmailOptions params = CreateEmailOptions.builder() .from("AcmeThanks for the payment
") .attachments(att) .build(); CreateEmailResponse data = resend.emails().send(params); } } ``` ```csharp .NET {14-18} using Resend; using System.Collections.Generic; IResend resend = ResendClient.Create( "re_xxxxxxxxx" ); // Or from DI var message = new EmailMessage() { From = "AcmeThanks for the payment
", }; message.Attachments = new ListThanks for the payment
", "attachments": [ { "path": "https://resend.com/static/sample/invoice.pdf", "filename": "invoice.pdf" } ] }' ```Thanks for the payment
', attachments: [ { content: attachment, filename: 'invoice.pdf', }, ], }); ``` ```php PHP {10-11} $resend = Resend::client('re_xxxxxxxxx'); $resend->emails->send([ 'from' => 'AcmeThanks for the payment
', 'attachments' => [ [ 'filename' => 'invoice.pdf', 'content' => $invoiceBuffer ] ] ]); ``` ```python Python {10} import os import resend resend.api_key = "re_xxxxxxxxx" f: bytes = open( os.path.join(os.path.dirname(__file__), "../static/invoice.pdf"), "rb" ).read() attachment: resend.Attachment = {"content": list(f), "filename": "invoice.pdf"} params: resend.Emails.SendParams = { "from": "AcmeThanks for the payment
", "attachments": [attachment], } resend.Emails.send(params) ``` ```rb Ruby {14-15} require "resend" Resend.api_key = "re_xxxxxxxxx" file = IO.read("invoice.pdf") params = { "from": "AcmeThanks for the payment
", "attachments": [ { "content": file.bytes, "filename": 'invoice.pdf', } ] } Resend::Emails.send(params) ``` ```go Go {19-20} import ( "fmt" "os" "github.com/resend/resend-go/v2" ) func main() { ctx := context.TODO() client := resend.NewClient("re_xxxxxxxxx") pwd, _ := os.Getwd() f, err := os.ReadFile(pwd + "/static/invoice.pdf") if err != nil { panic(err) } attachment := &resend.Attachment{ Content: f, Filename: "invoice.pdf", } params := &resend.SendEmailRequest{ From: "AcmeThanks for the payment
", Attachments: []*resend.Attachment{attachment}, } sent, err := client.Emails.SendWithContext(ctx, params) if err != nil { panic(err) } fmt.Println(sent.Id) } ``` ```rust Rust {22} use std::fs::File; use std::io::Read; use resend_rs::types::{Attachment, CreateEmailBaseOptions}; use resend_rs::{Resend, Result}; #[tokio::main] async fn main() -> Result<()> { let resend = Resend::new("re_xxxxxxxxx"); let from = "AcmeThanks for the payment
") .with_attachment(Attachment::from_content(invoice).with_filename(filename)); let _email = resend.emails.send(email).await?; Ok(()) } ``` ```java Java {8-9} import com.resend.*; public class Main { public static void main(String[] args) { Resend resend = new Resend("re_xxxxxxxxx"); Attachment att = Attachment.builder() .fileName("invoice.pdf") .content("invoiceBuffer") .build(); CreateEmailOptions params = CreateEmailOptions.builder() .from("AcmeThanks for the payment
") .attachments(att) .build(); CreateEmailOptions params = CreateEmailOptions.builder() } } ``` ```csharp .NET {15-19} using Resend; using System.Collections.Generic; using System.IO; IResend resend = ResendClient.Create( "re_xxxxxxxxx" ); // Or from DI var message = new EmailMessage() { From = "AcmeThanks for the payment
", }; message.Attachments = new ListThanks for the payment
", "attachments": [ { "content": "UmVzZW5kIGF0dGFjaG1lbnQgZXhhbXBsZS4gTmljZSBqb2Igc2VuZGluZyB0aGUgZW1haWwh%", "filename": "invoice.txt" } ] }' ```it works!
', headers: { 'X-Entity-Ref-ID': 'xxx_xxxx', }, }); ``` ```php PHP {9} $resend = Resend::client('re_xxxxxxxxx'); $resend->emails->send([ 'from' => 'Acmeit works!
', 'headers' => [ 'X-Entity-Ref-ID' => 'xxx_xxxx', ] ]); ``` ```python Python {11} import resend resend.api_key = "re_xxxxxxxxx" params: resend.Emails.SendParams = { "from": "onboarding@resend.dev", "to": ["delivered@resend.dev"], "subject": "hi", "html": "it works!
", "headers": { "X-Entity-Ref-ID": "xxx_xxxx" } } email = resend.Emails.send(params) print(email) ``` ```rb Ruby {11} require "resend" Resend.api_key = "re_xxxxxxxxx" params = { "from": "Acmeit works!
", "headers": { "X-Entity-Ref-ID": "123" }, } sent = Resend::Emails.send(params) puts sent ``` ```go Go {17} import ( "fmt" "github.com/resend/resend-go/v2" ) func main() { ctx := context.TODO() client := resend.NewClient("re_xxxxxxxxx") params := &resend.SendEmailRequest{ From: "Acmeit works!
", Headers: map[string]string{ "X-Entity-Ref-ID": "xxx_xxxx", } } sent, err := client.Emails.SendWithContext(ctx, params) if err != nil { panic(err) } fmt.Println(sent.Id) } ``` ```rust Rust {14} use resend_rs::types::{Attachment, CreateEmailBaseOptions, Tag}; use resend_rs::{Resend, Result}; #[tokio::main] async fn main() -> Result<()> { let resend = Resend::new("re_xxxxxxxxx"); let from = "Acmeit works!
") .with_header("X-Entity-Ref-ID", "xxx_xxxx"); let _email = resend.emails.send(email).await?; Ok(()) } ``` ```java Java {13} import com.resend.*; public class Main { public static void main(String[] args) { Resend resend = new Resend("re_xxxxxxxxx"); CreateEmailOptions params = CreateEmailOptions.builder() .from("Acmeit works!
") .headers(Map.of( "X-Entity-Ref-ID", "xxx_xxxx" )) .build(); CreateEmailResponse data = resend.emails().send(params); } } ``` ```csharp .NET {12-15} using Resend; using System.Collections.Generic; IResend resend = ResendClient.Create( "re_xxxxxxxxx" ); // Or from DI var message = new EmailMessage() { From = "Acmeit works!
", Headers = new Dictionaryit works!
", "headers": { "X-Entity-Ref-ID": "xxx_xxxx" } }' ```Here is our inline logo
Here is our inline logo
Here is our inline logo
Here is our inline logo
Here is our inline logo
Here is our inline logo
Here is our inline logo
Here is our inline logo
Here is our inline logo
Here is our inline logo
Here is our inline logo
Here is our inline logo
Here is our inline logo
Here is our inline logo
Here is our inline logo
Here is our inline logo
Here is our inline logo
Here is our inline logo
it works!
', }, { idempotencyKey: 'welcome-user/123456789', }, ); ``` ```php PHP {9} $resend = Resend::client('re_xxxxxxxxx'); $resend->emails->send([ 'from' => 'Acmeit works!
', ], [ 'idempotency_key' => 'welcome-user/123456789', ]); ``` ```python Python {9} params: resend.Emails.SendParams = { "from": "Acmeit works!
" } options: resend.Emails.SendOptions = { "idempotency_key": "welcome-user/123456789", } resend.Emails.send(params, options) ``` ```rb Ruby {9} params = { "from": "Acmeit works!
" } Resend::Emails.send( params, options: { idempotency_key: "welcome-user/123456789" } ) ``` ```go Go {9} ctx := context.TODO() params := &resend.SendEmailRequest{ From: "onboarding@resend.dev", To: []string{"delivered@resend.dev"}, Subject: "hello world", Html: "it works!
", } options := &resend.SendEmailOptions{ IdempotencyKey: "welcome-user/123456789", } _, err := client.Emails.SendWithOptions(ctx, params, options) if err != nil { panic(err) } ``` ```rust Rust {14} use resend_rs::types::CreateEmailBaseOptions; use resend_rs::{Resend, Result}; #[tokio::main] async fn main() -> Result<()> { let resend = Resend::new("re_xxxxxxxxx"); let from = "Acmeit works!
") .with_idempotency_key("welcome-user/123456789"); let _email = resend.emails.send(email).await?; Ok(()) } ``` ```java Java {9} CreateEmailOptions params = CreateEmailOptions.builder() .from("Acmeit works!
") .build(); RequestOptions options = RequestOptions.builder() .setIdempotencyKey("welcome-user/123456789").build(); CreateEmailResponse data = resend.emails().send(params, options); ``` ```csharp C# {11} using Resend; IResend resend = ResendClient.Create( "re_xxxxxxxxx" ); // Or from DI var key = IdempotencyKey.Newit works!
", } ); Console.WriteLine( "Email Id={0}", resp.Content ); ``` ```bash cURL {4} curl -X POST 'https://api.resend.com/emails' \ -H 'Authorization: Bearer re_xxxxxxxxx' \ -H 'Content-Type: application/json' \ -H 'Idempotency-Key: welcome-user/123456789' \ -d $'{ "from": "Acmeit works!
" }' ```it works!
', }, ], { idempotencyKey: 'team-quota/123456789', }, ); ``` ```php PHP {19} $resend = Resend::client('re_xxxxxxxxx'); $resend->batch->send( [ [ 'from' => 'Acmeit works!
', ] ], [ 'idempotency_key' => 'team-quota/123456789', ] ); ``` ```py Python {22} import resend from typing import List resend.api_key = "re_xxxxxxxxx" params: List[resend.Emails.SendParams] = [ { "from": "Acmeit works!
", } ] options: resend.Batch.SendOptions = { "idempotency_key": "team-quota/123456789", } resend.Batch.send(params, options) ``` ```rb Ruby {22} require "resend" Resend.api_key = 're_xxxxxxxxx' params = [ { "from": "Acmeit works!
", } ] Resend::Batch.send( params, options: { idempotency_key: "team-quota/123456789" } ) ``` ```go Go {32} package examples import ( "fmt" "os" "github.com/resend/resend-go/v2" ) func main() { ctx := context.TODO() client := resend.NewClient("re_xxxxxxxxx") var batchEmails = []*resend.SendEmailRequest{ { From: "Acmeit works!
", }, } options := &resend.BatchSendEmailOptions{ IdempotencyKey: "team-quota/123456789", } sent, err := client.Batch.SendWithOptions(ctx, batchEmails, options) if err != nil { panic(err) } fmt.Println(sent.Data) } ``` ```rust Rust {23} use resend_rs::types::CreateEmailBaseOptions; use resend_rs::{Resend, Result}; #[tokio::main] async fn main() -> Result<()> { let resend = Resend::new("re_xxxxxxxxx"); let emails = vec![ CreateEmailBaseOptions::new( "Acmeit works!
"), ]; let _emails = resend.batch.send_with_idempotency_key(emails, "team-quota/123456789").await?; Ok(()) } ``` ```java Java {23} import com.resend.*; public class Main { public static void main(String[] args) { Resend resend = new Resend("re_xxxxxxxxx"); CreateEmailOptions firstEmail = CreateEmailOptions.builder() .from("Acmeit works!
") .build(); CreateBatchEmailsResponse data = resend.batch().send( Arrays.asList(firstEmail, secondEmail), Map.of("idempotency_key", "team-quota/123456789") ); } } ``` ```csharp .NET {5} using Resend; IResend resend = ResendClient.Create( "re_xxxxxxxxx" ); // Or from DI var key = IdempotencyKey.Newit works!
", }; var mail2 = new EmailMessage() { From = "Acmeit works!
", }; var resp = await resend.EmailBatchAsync(key, [ mail1, mail2 ] ); Console.WriteLine( "Nr Emails={0}", resp.Content.Count ); ``` ```bash cURL {4} curl -X POST 'https://api.resend.com/emails/batch' \ -H 'Authorization: Bearer re_xxxxxxxxx' \ -H 'Content-Type: application/json' \ -H 'Idempotency-Key: team-quota/123456789' \ -d $'[ { "from": "Acmeit works!
" } ]' ```it works!
', scheduledAt: 'in 1 min', }); ``` ```php PHP {8} $resend = Resend::client('re_xxxxxxxxx'); $resend->emails->send([ 'from' => 'Acmeit works!
', 'scheduled_at' => 'in 1 min' ]); ``` ```python Python {10} import resend resend.api_key = "re_xxxxxxxxx" params: resend.Emails.SendParams = { "from": "Acmeit works!
", "scheduled_at": "in 1 min" } resend.Emails.send(params) ``` ```rb Ruby {10} require "resend" Resend.api_key = "re_xxxxxxxxx" params = { "from": "Acmeit works!
", "scheduled_at": "in 1 min" } Resend::Emails.send(params) ``` ```go Go {16} import ( "fmt" "github.com/resend/resend-go/v2" ) func main() { ctx := context.TODO() client := resend.NewClient("re_xxxxxxxxx") params := &resend.SendEmailRequest{ From: "Acmeit works!
", ScheduledAt: "in 1 min" } sent, err := client.Emails.SendWithContext(ctx, params) if err != nil { panic(err) } fmt.Println(sent.Id) } ``` ```rust Rust {14} use resend_rs::types::CreateEmailBaseOptions; use resend_rs::{Resend, Result}; #[tokio::main] async fn main() -> Result<()> { let resend = Resend::new("re_xxxxxxxxx"); let from = "Acmeit works!
") .with_scheduled_at("in 1 min"); let _email = resend.emails.send(email).await?; Ok(()) } ``` ```java Java {12} import com.resend.*; public class Main { public static void main(String[] args) { Resend resend = new Resend("re_xxxxxxxxx"); CreateEmailOptions params = CreateEmailOptions.builder() .from("Acmeit works!
") .scheduledAt("in 1 min") .build(); CreateEmailResponse data = resend.emails().send(params); } } ``` ```csharp .NET {11} using Resend; IResend resend = ResendClient.Create( "re_xxxxxxxxx" ); // Or from DI var resp = await resend.EmailSendAsync( new EmailMessage() { From = "Acmeit works!
", MomentSchedule = "in 1 min", } ); Console.WriteLine( "Email Id={0}", resp.Content ); ``` ```bash cURL {9} curl -X POST 'https://api.resend.com/emails' \ -H 'Authorization: Bearer re_xxxxxxxxx' \ -H 'Content-Type: application/json' \ -d $'{ "from": "Acmeit works!
", "scheduled_at": "in 1 min" }' ```it works!
', scheduledAt: oneMinuteFromNow, }); ``` ```php PHP {3} $resend = Resend::client('re_xxxxxxxxx'); $oneMinuteFromNow = (new DateTime())->modify('+1 minute')->format(DateTime::ISO8601); $resend->emails->send([ 'from' => 'Acmeit works!
', 'scheduled_at' => $oneMinuteFromNow ]); ``` ```python Python {6} import resend from datetime import datetime, timedelta resend.api_key = "re_xxxxxxxxx" one_minute_from_now = (datetime.now() + timedelta(minutes=1)).isoformat() params: resend.Emails.SendParams = { "from": "Acmeit works!
", "scheduled_at": one_minute_from_now } resend.Emails.send(params) ``` ```rb Ruby {5} require "resend" Resend.api_key = "re_xxxxxxxxx" one_minute_from_now = (Time.now + 1 * 60).strftime("%Y-%m-%dT%H:%M:%S.%L%z") params = { "from": "Acmeit works!
", "scheduled_at": one_minute_from_now } Resend::Emails.send(params) ``` ```go Go {12} import ( "fmt" "github.com/resend/resend-go/v2" ) func main() { ctx := context.TODO() client := resend.NewClient("re_xxxxxxxxx") oneMinuteFromNow := time.Now().Add(time.Minute * time.Duration(1)) oneMinuteFromNowISO := oneMinuteFromNow.Format("2006-01-02T15:04:05-0700") params := &resend.SendEmailRequest{ From: "Acmeit works!
", ScheduledAt: oneMinuteFromNowISO } sent, err := client.Emails.SendWithContext(ctx, params) if err != nil { panic(err) } fmt.Println(sent.Id) } ``` ```rust Rust {12-15} use chrono::{Local, TimeDelta}; use resend_rs::types::CreateEmailBaseOptions; use resend_rs::{Resend, Result}; #[tokio::main] async fn main() -> Result<()> { let resend = Resend::new("re_xxxxxxxxx"); let from = "Acmeit works!
") .with_scheduled_at(&one_minute_from_now); let _email = resend.emails.send(email).await?; Ok(()) } ``` ```java Java {7-10} import com.resend.*; public class Main { public static void main(String[] args) { Resend resend = new Resend("re_xxxxxxxxx"); String oneMinuteFromNow = Instant .now() .plus(1, ChronoUnit.MINUTES) .toString(); CreateEmailOptions params = CreateEmailOptions.builder() .from("Acmeit works!
") .scheduledAt(oneMinuteFromNow) .build(); CreateEmailResponse data = resend.emails().send(params); } } ``` ```csharp .NET {11} using Resend; IResend resend = ResendClient.Create( "re_xxxxxxxxx" ); // Or from DI var resp = await resend.EmailSendAsync( new EmailMessage() { From = "Acmeit works!
", MomentSchedule = DateTime.UtcNow.AddMinutes( 1 ), } ); Console.WriteLine( "Email Id={0}", resp.Content ); ``` ```bash cURL {9} curl -X POST 'https://api.resend.com/emails' \ -H 'Authorization: Bearer re_xxxxxxxxx' \ -H 'Content-Type: application/json' \ -d $'{ "from": "Acmeit works!
", "scheduled_at": "2024-08-20T11:52:01.858Z" }' ```it works!
', tags: [ { name: 'category', value: 'confirm_email', }, ], }); ``` ```php PHP {8-13} $resend = Resend::client('re_xxxxxxxxx'); $resend->emails->send([ 'from' => 'Acmeit works!
', 'tags' => [ [ 'name' => 'category', 'value' => 'confirm_email', ], ] ]); ``` ```python Python {10-12} import resend resend.api_key = "re_xxxxxxxxx" params: resend.Emails.SendParams = { "from": "Acmeit works!
", "tags": [ {"name": "category", "value": "confirm_email"}, ], } email = resend.Emails.send(params) print(email) ``` ```rb Ruby {10-12} require "resend" Resend.api_key = "re_xxxxxxxxx" params = { "from": "Acmeit works!
", "tags": [ {"name": "category", "value": "confirm_email"} ] } sent = Resend::Emails.send(params) puts sent ``` ```go Go {16} import ( "fmt" "github.com/resend/resend-go/v2" ) func main() { ctx := context.TODO() client := resend.NewClient("re_xxxxxxxxx") params := &resend.SendEmailRequest{ From: "Acmeit works!
", Subject: "hello world", Tags: []resend.Tag{{Name: "category", Value: "confirm_email"}}, } sent, err := client.Emails.SendWithContext(ctx, params) if err != nil { panic(err) } fmt.Println(sent.Id) } ``` ```rust Rust {14} use resend_rs::types::{CreateEmailBaseOptions, Tag}; use resend_rs::{Resend, Result}; #[tokio::main] async fn main() -> Result<()> { let resend = Resend::new("re_xxxxxxxxx"); let from = "Acmeit works!
") .with_tag(Tag::new("category", "confirm_email")); let _email = resend.emails.send(email).await?; Ok(()) } ``` ```java Java {17} import com.resend.*; public class Main { public static void main(String[] args) { Resend resend = new Resend("re_xxxxxxxxx"); Tag tag = Tag.builder() .name("category") .value("confirm_email") .build(); SendEmailRequest sendEmailRequest = SendEmailRequest.builder() .from("Acmeit works!
") .tags(tag) .build(); SendEmailResponse data = resend.emails().send(sendEmailRequest); } } ``` ```bash cURL {9-14} curl -X POST 'https://api.resend.com/emails' \ -H 'Authorization: Bearer re_xxxxxxxxx' \ -H 'Content-Type: application/json' \ -d $'{ "from": "Acmeit works!
", "tags": [ { "name": "category", "value": "confirm_email" } ] }' ```You have successfully signed up to example.com,
To log in to the site, just follow this link: <%= @url %>.
Thanks for joining and have a great day!
``` Initialize your `UserMailer` class. This should return a `UserMailer` instance. ```rb u = User.new name: "derich" mailer = UserMailer.with(user: u).welcome_email # => #You have successfully signed up to example.com,
To log in to the site, just follow this link: <%= @url %>.
Thanks for joining and have a great day!
``` Initialize your `UserMailer` class. This should return a `UserMailer` instance. ```rb u = User.new name: "derich" mailer = UserMailer.with(user: u).welcome_email # => #Hello world
', }); if (error) { return Response.json({ error }, { status: 500 }); } return Response.json({ data }); } catch (error) { return Response.json({ error }, { status: 500 }); } } ```