ตัวอย่างรีแอ็กชันทางอีเมล

ต่อไปนี้คือตัวอย่างข้อความรีแอ็กชันอีเมลทั้งที่ถูกต้องและไม่ถูกต้อง

ใช้ได้ตั้งแต่ 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--

ส่วนของร่างกายที่ถูกต้องชิ้นเดียว

รีแอ็กชันทางอีเมลอาจเป็นเพียงส่วนหนึ่งของร่างกายก็ได้ เช่น

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==

JSON ต้องเข้ารหัสเป็น UTF-8 สำหรับการเข้ารหัสไบนารี เช่น base64

multipart/alternative ที่ฝังที่ถูกต้องใน multipart/related

หากความรู้สึกคือข้อความที่มีไฟล์แนบแบบแทรกในบรรทัด คุณอาจสร้างข้อความที่มีส่วนเนื้อหา 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: text/vnd.google.email-reaction+json
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}

รีแอ็กชันต่อไปนี้ไม่ถูกต้องเนื่องจากไม่มีอีโมจิ ❤ ระหว่างอักขระตัวเชื่อมที่มีความกว้างเป็น 0 (ZWJ) 2 ตัว โปรดทราบว่าอักขระ = ที่ท้ายบรรทัดเนื้อหาแรกแสดงถึงการขึ้นเส้นแบ่งในการเข้ารหัสแบบ quod-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}