{"schema_version":"1.0","publisher":"Primitive SDKs","canonical_url":"https://test.abhinandan.one/go-forwarding-emails","markdown_url":"https://test.abhinandan.one/go-forwarding-emails.md","article":{"id":"e9a787a5-f4e2-40cc-9ab4-3e51cf25c0bc","article_slug":"go-forwarding-emails","parent_article_slug":null,"parent_article_title":null,"kind":"guide","published_at":"2026-08-11T18:54:53.125197+00:00","keywords":["Client.Forward","ForwardParams","forward an inbound email Go","sdk-go forward","buildForwardText"],"meta_description":"Client.Forward in the Go SDK sends an inbound ReceivedEmail to a new recipient as a fresh outbound message with a generated forwarded-message body.","og_image_url":null,"source_file_paths":["sdk-go/client.go","sdk-go/README.md"],"recording_id":null,"replayable":false,"task_name":"Forwarding Emails","category":"Go SDK","summary":null,"description":"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.","content_kind":"repo_page","content_markdown":"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](go-replying-to-emails) whenever the new recipient needs the original message content but isn't part of the existing conversation.\n\nUnder 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](go-sending-emails) for the underlying delivery semantics (wait mode, idempotency).\n\n## What you need before forwarding\n\n- A `*primitive.Client` constructed with [`primitive.NewClient`](go-client-configuration).\n- A `*primitive.ReceivedEmail` from [`primitive.Receive`](go-receiving-webhooks) or `ReceiveFromHTTPRequest`.\n- The recipient address for the forward.\n\n## Forward an inbound email\n\n<Steps>\n\n<Step title=\"Call Client.Forward with the inbound email and a recipient\">\n\nPass the `*ReceivedEmail` you received and a `ForwardParams` with at least `To`:\n\n```go\npackage main\n\nimport (\n\t\"context\"\n\t\"log\"\n\n\tprimitive \"github.com/primitivedotdev/sdks/sdk-go\"\n)\n\nfunc handleForward(ctx context.Context, client *primitive.Client, email *primitive.ReceivedEmail) {\n\tresult, err := client.Forward(ctx, email, primitive.ForwardParams{\n\t\tTo:       \"ops@example.com\",\n\t\tBodyText: \"Can you take this one?\",\n\t})\n\tif err != nil {\n\t\tlog.Printf(\"forward failed: %v\", err)\n\t\treturn\n\t}\n\tlog.Println(result.ID, result.Status)\n}\n```\n\n</Step>\n\n<Step title=\"Read the generated forwarded-message body\">\n\n`Forward` prepends your `BodyText` (when set) to a generated block, then appends the original email's headers and text body:\n\n```text\nCan you take this one?\n\n---------- Forwarded message ----------\nFrom: Alice <alice@example.com>\nTo: support@example.com\nSubject: Order question\nDate: Tue, 14 Dec 2025 11:59:50 +0000\nMessage-ID: <abc123@example.com>\n\n<original email text>\n```\n\nThe `Date` line only appears when the inbound email's headers included one; `Message-ID` only appears when the inbound thread had one.\n\n</Step>\n\n<Step title=\"Verify delivery\">\n\n`Forward` returns the same `SendResult` shape as `Send`: check `result.Status` and, when you cared enough to opt into [wait mode](email-model), `result.DeliveryStatus`. Forward has no `Wait` option of its own, see the note below.\n\n</Step>\n\n</Steps>\n\n## ForwardParams fields\n\n| Field | Required | Behavior |\n| --- | --- | --- |\n| `To` | yes | Recipient of the forwarded message. Validated as an email address. |\n| `BodyText` | no | Your own note, prepended above the generated forwarded block. |\n| `Subject` | no | Overrides the subject. Defaults to `email.ForwardSubject` (`Fwd: <original subject>`, idempotently prefixed). |\n| `From` | no | Overrides the From address. Defaults to `email.ReceivedBy` (the address that received the inbound email). |\n| `IdempotencyKey` | no | Deduplicates retries the same way [`Client.Send`](go-sending-emails) does. |\n\n<Tip>\n\nForward routes through `Client.Send` internally, so the same [request validation rules](go-sending-emails) apply: `To` must be a syntactically valid address, and the SDK rejects a call before it reaches the network if not.\n\n</Tip>\n\n<Warning>\n\n`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`.\n\n</Warning>\n\n## Next steps\n\n<CardGroup cols={2}>\n\n<Card title=\"Sending Emails\" href=\"go-sending-emails\">\n\nSend a new outbound email directly with Client.Send, including wait mode and idempotency keys.\n\n</Card>\n\n<Card title=\"Replying to Emails\" href=\"go-replying-to-emails\">\n\nReply to the original sender instead of forwarding to a new recipient.\n\n</Card>\n\n<Card title=\"Receiving and Verifying Webhooks\" href=\"go-receiving-webhooks\">\n\nGet the ReceivedEmail value that Forward and Reply both take as input.\n\n</Card>\n\n<Card title=\"Inbound and Outbound Email Model\" href=\"email-model\">\n\nUnderstand the normalized email object and wait-mode delivery statuses shared across every SDK.\n\n</Card>\n\n</CardGroup>","canonical_base_url":"https://test.abhinandan.one","seo_indexing_enabled":true,"last_modified":"2026-08-21T18:22:43.359885+00:00","video_url":null,"voiceover_url":null,"tools_used":[],"demonstrated_by":[],"steps":[],"related_links":[],"intro":null,"prerequisites":[],"verification":[],"troubleshooting":[],"suggest_edit_url":"https://github.com/abhi-browzer/primitive-sdks/edit/main/sdk-go/client.go","raise_issue_url":"https://github.com/abhi-browzer/primitive-sdks/issues/new?title=Docs+feedback%3A+Forwarding+Emails&body=Page%3A+https%3A%2F%2Ftest.abhinandan.one%2Fgo-forwarding-emails","page_feedback_enabled":true,"verified_ref":null,"verified_at":"2026-08-11T18:38:45.205849+00:00"}}