Forwarding Emails
Forward a received email to a new recipient with the Go SDK's Client.Forward, which builds a "Forwarded message" body from the original email and sends it as a new outbound message.
Use Client.Forward when you want to hand an inbound email off to someone who wasn't on the original thread, rather than replying to the sender. Reach for this instead of Client.Reply whenever the new recipient needs the original message content but isn't part of the existing conversation.
Under the hood, Forward is not a distinct API operation: it builds a SendParams value from the ReceivedEmail and calls Client.Send, so a forward is really a synthesized outbound send. See Sending Emails for the underlying delivery semantics (wait mode, idempotency).
What you need before forwarding#
- A
*primitive.Clientconstructed withprimitive.NewClient. - A
*primitive.ReceivedEmailfromprimitive.ReceiveorReceiveFromHTTPRequest. - The recipient address for the forward.
Forward an inbound email#
- 1
Call Client.Forward with the inbound email and a recipient#
Pass the
*ReceivedEmailyou received and aForwardParamswith at leastTo:package main import ( "context" "log" primitive "github.com/primitivedotdev/sdks/sdk-go" ) func handleForward(ctx context.Context, client *primitive.Client, email *primitive.ReceivedEmail) { result, err := client.Forward(ctx, email, primitive.ForwardParams{ To: "ops@example.com", BodyText: "Can you take this one?", }) if err != nil { log.Printf("forward failed: %v", err) return } log.Println(result.ID, result.Status) } - 2
Read the generated forwarded-message body#
Forwardprepends yourBodyText(when set) to a generated block, then appends the original email's headers and text body:Can you take this one? ---------- Forwarded message ---------- From: Alice <alice@example.com> To: support@example.com Subject: Order question Date: Tue, 14 Dec 2025 11:59:50 +0000 Message-ID: <abc123@example.com> <original email text>The
Dateline only appears when the inbound email's headers included one;Message-IDonly appears when the inbound thread had one. - 3
ForwardParams fields#
| Field | Required | Behavior |
|---|---|---|
To | yes | Recipient of the forwarded message. Validated as an email address. |
BodyText | no | Your own note, prepended above the generated forwarded block. |
Subject | no | Overrides the subject. Defaults to email.ForwardSubject (Fwd: <original subject>, idempotently prefixed). |
From | no | Overrides the From address. Defaults to email.ReceivedBy (the address that received the inbound email). |
IdempotencyKey | no | Deduplicates retries the same way Client.Send does. |
Forward routes through Client.Send internally, so the same request validation rules apply: To must be a syntactically valid address, and the SDK rejects a call before it reaches the network if not.
ForwardParams has no Wait field. If you need the first downstream SMTP delivery outcome for the forwarded message before your handler returns, call Client.Send directly with Wait set instead of Client.Forward.
Next steps#
Send a new outbound email directly with Client.Send, including wait mode and idempotency keys.
Replying to EmailsReply to the original sender instead of forwarding to a new recipient.
Receiving and Verifying WebhooksGet the ReceivedEmail value that Forward and Reply both take as input.
Inbound and Outbound Email ModelUnderstand the normalized email object and wait-mode delivery statuses shared across every SDK.
Was this page helpful?