Skip to content

メールテンプレートを作成する

post

/templates/email/create

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

これらのテンプレートはテンプレートとメディアページで利用できます。このエンドポイントからの応答にはemail_template_idフィールドが含まれており、後続のAPI呼び出しでテンプレートを更新するために使用できます。

前提条件

このエンドポイントを使用するには、templates.email.create権限を持つ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
{
   "template_name": (required, string) The name of your email template,
   "subject": (required, string) The email template subject line,
   "body": (required, 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 is used on this template.
 }

リクエストパラメーター

リクエスト例

1
2
3
4
5
6
7
8
9
10
11
curl --location --request POST 'https://rest.iad-01.braze.com/templates/email/create' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer YOUR_REST_API_KEY' \
--data-raw '{
  "template_name": "email_template_name",
  "subject": "Welcome to my email template!",
  "body": "This is the text within my email body and https://www.braze.com/ here is a link to Braze.com.",
  "plaintext_body": "This is the text within my email body and here is a link to https://www.braze.com/.",
  "preheader": "My preheader is pretty cool.",
  "tags": ["Tag1", "Tag2"]
}'

応答例

1
2
3
4
{
  "email_template_id": "232b6d29-7e41-4106-a0ab-1c4fe915d701",
  "message": "success"
}

トラブルシューティング

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

New Stuff!