Email Message
Email Message は、AM のメール基盤を通じて送受信されたメールの記録です。
スキーマ
interface EmailMessage {
id: string; // "eml_..." - 一意識別子
account_id: string; // 所有アカウント
hostname: string; // 送信ドメイン
direction: "in" | "out"; // 受信または送信
from_contact: EmailContact;
reply_to_contacts: EmailContact[];
to_contacts: EmailContact[];
cc_contacts: EmailContact[];
bcc_contacts: EmailContact[];
subject: string;
body_text: string;
body_html: string;
received_at: string | null;
sent_at: string | null;
}
interface EmailContact {
email: string;
name?: string;
}
プロパティ
| Property | Type | Description |
|---|---|---|
id | string | eml_ プレフィックス付き KSUID |
account_id | string | このメッセージを所有する Account |
hostname | string | 送信に使われたドメイン |
direction | enum | in は受信、out は送信 |
from_contact | object | 送信者情報 |
reply_to_contacts | array | Reply-To 連絡先 |
to_contacts | array | 主宛先 |
cc_contacts | array | CC 宛先 |
bcc_contacts | array | BCC 宛先 |
subject | string | メール件名 |
body_text | string | プレーンテキスト本文 |
body_html | string | HTML 本文 |
received_at | string? | 受信メールを受け取った時刻 |
sent_at | string? | 送信メールを送信した時刻 |
例
{
"id": "eml_2kHfPZcN9xW4mE8RtY7vB",
"account_id": "acc_1jGePYbM8wV3lD7QsX6uA",
"hostname": "mail.example.com",
"direction": "out",
"from_contact": {
"email": "noreply@example.com",
"name": "Acme Corp"
},
"reply_to_contacts": [],
"to_contacts": [{ "email": "user@example.com", "name": "Jane Doe" }],
"cc_contacts": [],
"bcc_contacts": [],
"subject": "Welcome to Acme",
"body_text": "Welcome...",
"body_html": "<h1>Welcome</h1>...",
"sent_at": "2025-01-15T10:30:00Z"
}
関連
- Email Message Event - 配信追跡
- Email Template - 再利用可能テンプレート
- Email - メール基盤