AM
JA
無料で始める
メニュー

Email Template

変数プレースホルダーでパーソナライズできる再利用可能メールテンプレート。

email メール template テンプレート personalization パーソナライズ variables 変数

Email Template

Email Template は、変数プレースホルダー({{variable}})を使って動的にパーソナライズできる再利用可能メールコンテンツを定義します。

スキーマ

interface EmailTemplate {
  id: string; // "emt_..." - 一意識別子
  account_id: string; // 所有アカウント
  name: string; // テンプレート名
  event_type: string; // ビジネスイベント(例: "user_welcome")
  editor: "grapesjs_mjml"; // テンプレートエディタ
  editor_state: string; // シリアライズ済みエディタ状態
  mjml: string; // MJML ソース
  subject_template: string; // 変数付き件名
  body_text_template: string; // 変数付きテキスト本文
  body_html_template: string; // 変数付き HTML 本文
  archived_at: string | null; // アーカイブ日時
}

プロパティ

PropertyTypeDescription
idstringemt_ プレフィックス付き KSUID
account_idstringこのテンプレートを所有する Account
namestring人間が読める名前
event_typestringイベントトリガー名
editorstringエディタ種別
editor_statestringシリアライズ済みエディタ状態
mjmlstringMJML ソース
subject_templatestring件名テンプレート
body_text_templatestringテキスト本文テンプレート
body_html_templatestringHTML 本文テンプレート
archived_atstring?アーカイブ時刻

変数構文

置換には {{variable_name}} を使用します。

Subject: Welcome, {{name}}!

Dear {{name}},

Your account {{account_name}} is ready.

Best regards,
The {{company}} Team

使い方

テンプレート送信の例:

{
  "template_id": "emt_...",
  "to": [{ "email": "user@example.com" }],
  "variables": {
    "name": "Jane",
    "account_name": "Acme Corp",
    "company": "Example Inc"
  }
}

{
  "id": "emt_2kHfPZcN9xW4mE8RtY7vB",
  "account_id": "acc_1jGePYbM8wV3lD7QsX6uA",
  "name": "welcome",
  "event_type": "user_welcome",
  "editor": "grapesjs_mjml",
  "editor_state": "{}",
  "mjml": "<mjml><mj-body></mj-body></mjml>",
  "subject_template": "Welcome to {{company}}, {{name}}!",
  "body_text_template": "Hi {{name}},\n\nWelcome to {{company}}...",
  "body_html_template": "<h1>Welcome, {{name}}!</h1>...",
  "archived_at": null
}

関連