Skip to content

既存のメールテンプレートを更新する

post

/templates/email/update

このエンドポイントを使用して、Brazeダッシュボードのメールテンプレートを更新します。

メールテンプレートのemail_template_idには、テンプレートとメディアページからアクセスできます。メールテンプレートの作成エンドポイントemail_template_idの参照を返します。

email_template_id以外のフィールドはすべてオプションですが、更新するフィールドを少なくとも1つ指定する必要があります。

前提条件

このエンドポイントを使用するには、templates.email.update権限を持つAPIキーが必要です。

レート制限

APIレート制限に記載されているように、このエンドポイントにはデフォルトのBrazeレート制限(1時間あたり250,000リクエスト)が適用されます。

リクエスト本文

1
2
Content-Type: application/json
Authorization: Bearer YOUR_REST_API_KEY
1
2
3
4
5
6
7
8
9
10
{
  "email_template_id": (required, string) Your email template's API Identifier,
  "template_name": (optional, string) The name of your email template,
  "subject": (optional, string) The email template subject line,
  "body": (optional, string) The email template body that may include HTML,
  "plaintext_body": (optional, string) A plaintext version of the email template body,
  "preheader": (optional, string) The email preheader used to generate previews in some clients,
  "tags": (optional, array of Strings) Tags must already exist,
  "should_inline_css": (optional, Boolean) If `true`, the `inline_css` feature will be applied to the template.
}

リクエストパラメーター

パラメーター 必須 データタイプ 説明
email_template_id 必須 文字列 メールテンプレートのAPI識別子
template_name オプション 文字列 メールテンプレートの名前。
subject オプション 文字列 メールテンプレートの件名。
body オプション 文字列 HTMLを含む可能性のあるメールテンプレート本文。
plaintext_body オプション 文字列 メールテンプレート本文のプレーンテキストバージョン。
preheader オプション 文字列 一部のクライアントでプレビューを生成するために使用されるメールプリヘッダー。
tags オプション 文字列 タグはすでに存在している必要があります。
should_inline_css オプション ブール値 テンプレートごとにinline_css機能を有効または無効にします。指定されない場合、BrazeはAppGroupのデフォルト設定を使用します。trueまたはfalseのいずれかを指定します。

リクエスト例

1
2
3
4
5
6
7
8
9
10
11
12
curl --location --request POST 'https://rest.iad-01.braze.com/templates/email/update' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer YOUR_REST_API_KEY' \
--data-raw '{
  "email_template_id": "email_template_id",
  "template_name": "Weekly Newsletter",
  "subject": "This Week'\''s Styles",
  "body": "Check out this week'\''s digital lookbook to inspire your outfits. Take a look at https://www.braze.com/",
  "plaintext_body": "This is the updated text within my email body and here is a link to https://www.braze.com/.",
  "preheader": "We want you to have the best looks this summer",
  "tags": ["Tag1", "Tag2"]
}'

トラブルシューティング

以下の表は、返される可能性のあるエラーと、該当する場合の関連するトラブルシューティング手順を示しています。

エラー トラブルシューティング
テンプレート名は必須です テンプレート名を入力してください。
タグは配列でなければなりません タグは文字列の配列としてフォーマットする必要があります(例: ["marketing", "promotional", "transactional"])。
すべてのタグは文字列でなければなりません タグが引用符("")で囲まれていることを確認してください。
一部のタグが見つかりませんでした メールテンプレート作成時にタグを追加するには、そのタグがすでにBrazeに存在している必要があります。
should_inline_cssの値が無効です。trueまたはfalseのいずれかが必要です このパラメーターはブール値(trueまたはfalse)のみを受け付けます。should_inline_cssの値が引用符("")で囲まれていないことを確認してください。囲まれている場合、値は文字列として送信されます。
New Stuff!