有効なメール リアクション メッセージと無効なメール リアクション メッセージの例を次に示します。
有効期間: multipart/alternative
メールのリアクションは通常、次の 3 つの部分で構成されています。
text/plain
: メッセージのプレーンテキスト バージョン。text/vnd.google.email-reaction+json
: リアクション部分。text/html
: メッセージの HTML バージョン。
次の例をご覧ください。
From: test@google.com
Message-ID: <884457408.1.1697791227669@mail.google.com>
Subject: subject
MIME-Version: 1.0
In-Reply-To: <2938749223.1.39847234@mail.google.com>
Content-Type: multipart/alternative;
boundary="----=_Part_0_2012232625.1697791227635"
------=_Part_0_2012232625.1697791227635
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Text body content
------=_Part_0_2012232625.1697791227635
Content-Type: text/vnd.google.email-reaction+json; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
{"emoji":"=F0=9F=99=83","version":1}
------=_Part_0_2012232625.1697791227635
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
<h1>HTML body content</h1>
------=_Part_0_2012232625.1697791227635--
1 つの有効な身体部位
メールのリアクションは、次のように 1 つのボディパーツのみにすることもできます。
From: test+no-reply@google.com
Message-ID: <940553268.0.1697791227697@mail.google.com>
Subject: subject
MIME-Version: 1.0
In-Reply-To: <2938749223.1.39847234@mail.google.com>
Content-Type: text/vnd.google.email-reaction+json; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
{"emoji":"=F0=9F=99=83","version":1}
Content-Transfer-Encoding
は任意の標準エンコードにできます。
From: test+no-reply@google.com
Message-ID: <940553268.0.1697791227697@mail.google.com>
Subject: subject
MIME-Version: 1.0
In-Reply-To: <2938749223.1.39847234@mail.google.com>
Content-Type: text/vnd.google.email-reaction+json
Content-Transfer-Encoding: base64
ewogICJlbW9qaSI6ICLwn46JIiwKICAidmVyc2lvbiI6IDEKfQ==
base64
などのバイナリ エンコードの場合、JSON は UTF-8 としてエンコードする必要があります。
multipart/related
内の有効なネストされた multipart/alternative
リアクションがインライン添付ファイルを含むメッセージに対するものである場合は、添付ファイルを含む multipart/related
本文部分と、前の例のような multipart/alternative
部分を含むメッセージを生成できます。
From: test@google.com
Message-ID: <913190639.2.1697793303663@mail.google.com>
Subject: subject
MIME-Version: 1.0
In-Reply-To: <2938749223.1.39847234@mail.google.com>
Content-Type: multipart/related;
boundary="----=_Part_0_2012232625.1697793303618"
------=_Part_0_2012232625.1697793303618
Content-Type: multipart/alternative;
boundary="----=_Part_1_984213526.1697793303621"
------=_Part_1_984213526.1697793303621
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Text body content
------=_Part_1_984213526.1697793303621
Content-Type: text/vnd.google.email-reaction+json
Content-Transfer-Encoding: base64
ewogICJlbW9qaSI6ICLwn46JIiwKICAidmVyc2lvbiI6IDEKfQ==
------=_Part_1_984213526.1697793303621
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
<h1>HTML body content</h1>
------=_Part_1_984213526.1697793303621--
------=_Part_0_2012232625.1697793303618
Content-Type: image/png
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="1x1.png"
iVBORw0KGgoAAAANSUhEUgAAAAEAAAABAQMAAAAl21bKAAAAA1BMVEUAAACnej3aAAAAAXRSTlMA
QObYZgAAAApJREFUCNdjYAAAAAIAAeIhvDMAAAAASUVORK5CYII=
------=_Part_0_2012232625.1697793303618--
(multipart/related
本文部分には RFC2387 で指定されている他のフィールドが必要ですが、メールのリアクションが有効かどうかを判断する際には関係ありません)。
JSON
の形式が無効です
次のリアクションは、JSON に閉じかっこがないため無効です。
From: test+no-reply@google.com
Message-ID: <940553268.0.1697791227697@mail.google.com>
Subject: subject
MIME-Version: 1.0
In-Reply-To: <2938749223.1.39847234@mail.google.com>
Content-Type: text/vnd.google.email-reaction+json; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
{"emoji":"=F0=9F=99=83","version":1
次のリアクションは、JSON に末尾にカンマが含まれているため無効です。
From: test+no-reply@google.com
Message-ID: <940553268.0.1697791227697@mail.google.com>
Subject: subject
MIME-Version: 1.0
In-Reply-To: <2938749223.1.39847234@mail.google.com>
Content-Type: text/vnd.google.email-reaction+json; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
{"emoji":"=F0=9F=99=83","version":1,}
無効な version
フィールド
次のリアクションは、version
フィールドがないため無効です。
From: test+no-reply@google.com
Message-ID: <940553268.0.1697791227697@mail.google.com>
Subject: subject
MIME-Version: 1.0
In-Reply-To: <2938749223.1.39847234@mail.google.com>
Content-Type: text/vnd.google.email-reaction+json; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
{"emoji":"=F0=9F=99=83"}
次のリアクションは、version
フィールドが 1
ではないため無効です。
From: test+no-reply@google.com
Message-ID: <940553268.0.1697791227697@mail.google.com>
Subject: subject
MIME-Version: 1.0
In-Reply-To: <2938749223.1.39847234@mail.google.com>
Content-Type: text/vnd.google.email-reaction+json; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
{"emoji":"=F0=9F=99=83","version":2}
無効な emoji
フィールド
emoji
フィールドが空であるため、次のリアクションは無効です。
From: test+no-reply@google.com
Message-ID: <940553268.0.1697791227697@mail.google.com>
Subject: subject
MIME-Version: 1.0
In-Reply-To: <2938749223.1.39847234@mail.google.com>
Content-Type: text/vnd.google.email-reaction+json; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
{"emoji":"","version":1}
次のリアクションは、emoji
フィールドに有効な絵文字が含まれていないため、無効です。
From: test+no-reply@google.com
Message-ID: <940553268.0.1697791227697@mail.google.com>
Subject: subject
MIME-Version: 1.0
In-Reply-To: <2938749223.1.39847234@mail.google.com>
Content-Type: text/vnd.google.email-reaction+json; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
{"emoji":"A","version":1}
次のリアクションは、2 つのゼロ幅結合子(ZWJ)文字の間に ❤ 絵文字がないため、無効です。最初のコンテンツ行の末尾にある = 文字は、Quoted-Printable エンコードのソフト ラインブレークを表します。
From: test+no-reply@google.com
Message-ID: <940553268.0.1697791227697@mail.google.com>
Subject: subject
MIME-Version: 1.0
In-Reply-To: <2938749223.1.39847234@mail.google.com>
Content-Type: text/vnd.google.email-reaction+json; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
{"emoji":"=F0=9F=91=A9=F0=9F=8F=BC=E2=80=8D=E2=80=8D=F0=9F=91=A8=F0=9F=8F=BE",=
"version":1}