From 99572b2f02d88b092b3cd3e8a628bc4ffec46399 Mon Sep 17 00:00:00 2001 From: xsekiguchi Date: Thu, 19 Feb 2026 22:26:10 +0900 Subject: [PATCH 1/5] =?UTF-8?q?SendGrid:=20Web=20API=20v3=E5=88=A9?= =?UTF-8?q?=E7=94=A8=E6=99=82=E3=81=AB=E3=83=9C=E3=83=87=E3=82=A3=E3=83=91?= =?UTF-8?q?=E3=83=A9=E3=83=A1=E3=83=BC=E3=82=BF=E3=82=92=E4=B8=8A=E6=9B=B8?= =?UTF-8?q?=E3=81=8D=E5=8F=AF=E8=83=BD=E3=81=AB=E3=81=99=E3=82=8B=EF=BC=88?= =?UTF-8?q?=E3=83=89=E3=82=AD=E3=83=A5=E3=83=A1=E3=83=B3=E3=83=88=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - ServiceConfig SendGridV3MailService に canOverwriteBodyParameter の説明を追加 - Developer Guide 通知のSendGrid固有オプションの設定に、本文パラメータの設定方法の説明を追加 --- .../src/docs/asciidoc/notification/mail.adoc | 8 ++++++-- .../src/docs/asciidoc/core/mailservice_en.adoc | 12 ++++++++++++ .../src/docs/asciidoc/core/mailservice_ja.adoc | 11 +++++++++++ 3 files changed, 29 insertions(+), 2 deletions(-) diff --git a/developerguide/src/docs/asciidoc/notification/mail.adoc b/developerguide/src/docs/asciidoc/notification/mail.adoc index 53cc6a7..2bda70d 100644 --- a/developerguide/src/docs/asciidoc/notification/mail.adoc +++ b/developerguide/src/docs/asciidoc/notification/mail.adoc @@ -226,7 +226,10 @@ SendGrid固有オプションは以下の手順で設定します。詳しい実 ==== 注意事項 固有オプションを設定する場合、以下の点に注意してください。 -* Mail インスタンスに設定されている情報から作成するオプション(例: personalizations, content など)は設定できません。設定した場合、そのオプションは上書きされます。 +* Mail インスタンスに設定されている情報から作成するオプション(例: personalizations, content など)は設定できません。設定した場合、そのオプションは削除されます。 +** 標準の機能では対応できない設定を行いたい場合( `personalizations[n].substitutions` の設定など )は、固有オプションを設定する必要がありますが、通常 personalizations, content など特定の固有オプション値は削除されてしまいます。 + +SendGridV3MailService の `canOverwriteBodyParameter` プロパティを true に設定することで、固有オプションの設定値を削除せずに利用することができます。 + +SendGridV3MailService の設定の詳細は <<../../serviceconfig/index.adoc#MailService_SendGridV3MailService, MailService - SendGridV3MailService>> を参照してください。 * 固有オプションを設定した場合、存在の有無にかかわらずSendGridメール送信リクエストのボディに追加されます。 ** アプリケーションのセキュリティ上のリスク軽減のため、ユーザー入力値を無加工でオプションの値として設定しないでください。 ** 意図しないオプションが設定されないように、事前にバリデーションを行うことを推奨します。 @@ -274,7 +277,8 @@ private void sendMailWithSendGridOptions() { "html", "This is the footer html." ) )); - // 上記の指定で、以下のような値が追加されます。 + + // 上記の指定で、メール送信時のリクエストボディに以下のような値が追加されます。 // // { // "asm": { diff --git a/serviceconfig/src/docs/asciidoc/core/mailservice_en.adoc b/serviceconfig/src/docs/asciidoc/core/mailservice_en.adoc index 57baa9a..ec5aa04 100644 --- a/serviceconfig/src/docs/asciidoc/core/mailservice_en.adoc +++ b/serviceconfig/src/docs/asciidoc/core/mailservice_en.adoc @@ -414,6 +414,7 @@ It is similar to the <> in MailServiceImpl. ---- +[[MailService_SendGridV3MailService]] ==== [.eeonly]#Settings of SendGridV3MailService# To use SendGrid Web API v3, please specify and configure the SendGridV3MailService. @@ -428,6 +429,14 @@ To use SendGrid Web API v3, please specify and configure the SendGridV3MailServi | listener | <>, Multiple | The listener for sending the mail. | retryIntervalMillis | long | The retry interval when the transmission fails.(in millisecond) | retryCount | int | The number of retry attempts for email transmission to fail. +| canOverwriteBodyParameter | boolean | Whether to allow overwriting the body parameters in the SendGrid Web API v3 request. The default value is false. + +The Mail class used in the SendGrid Web API v3 request is SendGridMail. + +SendGridMail has the putBodyParameter and setBodyParameters methods, which can be used to set API-specific parameters. +The added specific parameters are added to the body of the SendGrid Web API v3 request. + +If this parameter is false, the body parameters created from the information set in SendGridMail (e.g., personalizations, content, etc.) will be sanitized if they exist in the added specific parameters. + +By setting this parameter to true, the specific parameters can be used without sanitization. + +In cases where you need to embed different strings in the body or subject for each recipient, and the standard settings cannot handle it, you may consider setting this parameter to true. |=== [[HttpClientConfig]] @@ -484,6 +493,9 @@ It is similar to the <> in MailServiceImpl. + + + + +