Get stored message content
/v1/email/messages/{message_id}/contentconst content = await bird.email.content("em_01krdgeqcxet5s7t44vh8rt9mg", {
recipient_id: "er_01krdgeqcxet5s7t44vh8rt9mg",
});
console.log(content.html, content.text);content = client.email.content(
"em_01krdgeqcxet5s7t44vh8rt9mg", recipient_id="er_01krdgeqcxet5s7t44vh8rt9mg"
)
print(content.html, content.text)content, err := client.Email.Content(context.Background(), "em_01krdgeqcxet5s7t44vh8rt9mg", bird.EmailContentParams{
RecipientID: "er_01krdgeqcxet5s7t44vh8rt9mg",
})
if err != nil {
log.Fatal(err)
}
if content.Html != nil {
fmt.Println(*content.Html)
}
if content.Text != nil {
fmt.Println(*content.Text)
}$content = $bird->email->content('em_01krdgeqcxet5s7t44vh8rt9mg', [
'recipient_id' => 'er_01krdgeqcxet5s7t44vh8rt9mg',
]);
echo $content->getHtml(), ' ', $content->getText();bird email content <message-id>curl -X GET "https://us1.platform.bird.com/v1/email/messages/{message_id}/content" \
-H "Authorization: Bearer $TOKEN"{
"html": "<p>Hi Jane,</p><p>Your order #1234 has shipped and is on its way.</p>",
"text": "Hi Jane,\n\nYour order #1234 has shipped and is on its way."
}
Returns the stored HTML and text bodies for a sent message. Content storage must be enabled for the message. Content is available for up to 30 days after sending. A broadcast message can return 404 even when workspace content storage is enabled. Verify email previews preserve the message with the verification code masked. A 404 indicates content is unavailable for this message. A scheduled send of a workspace template, rather than a built-in one, stores its content when it sends, so it answers 404 until then. A 425 indicates the content is still being stored and the request can be retried shortly. A 410 indicates the content was stored but has since expired.
Parameter
message_idstringID of the message whose stored content to fetch. A broadcast records one message per recipient, and List email messages returns those copies alongside ordinary sends. For a single send, this is the message's own ID, from the send response's id field.
Abfrageparameter
recipient_idstringRecipient whose accepted template values to render. Required for a message with multiple recipient snapshots; omission returns 422. A single recipient is selected automatically. An unknown recipient or one belonging to another message returns 404. Get the ID from the message's recipients listing.
Antwort-Payload
htmlThe HTML body of the message as delivered, if it was stored.
textThe plain-text body of the message as delivered, if it was stored.
Verwandte Ressourcen
Weiter mit der Dokumentation, Anleitungen und Beispielen zu diesem Thema.