Documentation Index
Fetch the complete documentation index at: https://mintlify.com/resend/resend-go/llms.txt
Use this file to discover all available pages before exploring further.
Update
Updates a scheduled email with the given parameters.
func (s *EmailsSvcImpl) Update(params *UpdateEmailRequest) (*UpdateEmailResponse, error)
Parameters
params
*UpdateEmailRequest
required
The update parameters.Show UpdateEmailRequest fields
The unique identifier of the scheduled email to update.
New scheduled time for the email. Format: ISO 8601 (e.g., “2024-11-05T11:52:01.858Z”).
Returns
Show UpdateEmailResponse fields
The unique identifier of the updated email.
The object type (“email”).
Example
package main
import (
"fmt"
"github.com/resend/resend-go/v3"
)
func main() {
client := resend.NewClient("re_123456789")
updateParams := &resend.UpdateEmailRequest{
Id: "4ef9a417-02e9-4d39-ad75-9611e0fcc33c",
ScheduledAt: "2024-11-05T11:52:01.858Z",
}
updated, err := client.Emails.Update(updateParams)
if err != nil {
panic(err)
}
fmt.Printf("Updated email: %s\n", updated.Id)
}
UpdateWithContext
Updates a scheduled email with the given parameters and context.
func (s *EmailsSvcImpl) UpdateWithContext(ctx context.Context, params *UpdateEmailRequest) (*UpdateEmailResponse, error)
Parameters
params
*UpdateEmailRequest
required
The update parameters. See Update for field details.
Returns
See Update for response field details.
Example
package main
import (
"context"
"fmt"
"github.com/resend/resend-go/v3"
)
func main() {
ctx := context.Background()
client := resend.NewClient("re_123456789")
// First, schedule an email
sendParams := &resend.SendEmailRequest{
From: "onboarding@resend.dev",
To: []string{"delivered@resend.dev"},
Subject: "Scheduled Email",
Text: "This email will be sent later",
ScheduledAt: "2024-09-05T11:52:01.858Z",
}
sent, err := client.Emails.SendWithContext(ctx, sendParams)
if err != nil {
panic(err)
}
// Update the scheduled time
updateParams := &resend.UpdateEmailRequest{
Id: sent.Id,
ScheduledAt: "2024-11-05T11:52:01.858Z",
}
updated, err := client.Emails.UpdateWithContext(ctx, updateParams)
if err != nil {
panic(err)
}
fmt.Printf("Updated email: %s\n", updated.Id)
}