Mail

Mail設定

以下の設定はWeb API v3 Mail Sendエンドポイントのmail_settingsオブジェクトでも指定できます。

Mail設定一覧の取得 [GET]

URI引数 必須 条件 説明
limit No number 結果を取得する件数を制限します。
Example: 20
offset No number 結果を取得する位置のオフセットを指定します。
Example: 1

Request

1
GET https://api.sendgrid.com/v3/mail_settings?limit={limit}&offset={offset} HTTP/1.1

Response

1
2
3
4
5
6
7
8
9
10
11
HTTP/1.1 200
{
  "result": [
    {
      "name": "bcc",
      "title": "BCC",
      "description": "lorem ipsum... .",
      "enabled": true
    }
  ]
}

BCC設定の取得 [GET]

Request

1
GET https://api.sendgrid.com/v3/mail_settings/bcc HTTP/1.1

Response

1
2
3
4
5
HTTP/1.1 200
{
  "enabled": true,
  "email": "email@example.com"
}

BCC設定の更新 [PATCH]

Request

1
PATCH https://api.sendgrid.com/v3/mail_settings/bcc HTTP/1.1
Request Body
1
2
3
4
{
  "enabled": true,
  "email": "email@example.com"
}

Response

1
2
3
4
5
HTTP/1.1 200
{
  "enabled": true,
  "email": "email@example.com"
}

Address Whitelist設定の取得 [GET]

Request

1
GET https://api.sendgrid.com/v3/mail_settings/address_whitelist HTTP/1.1

Response

1
2
3
4
5
6
7
8
HTTP/1.1 200
{
  "enabled": true,
  "list": [
    "email1@example.com",
    "example.com"
  ]
}

Address Whitelist設定の更新 [PATCH]

Request

1
PATCH https://api.sendgrid.com/v3/mail_settings/address_whitelist HTTP/1.1
Request Body
1
2
3
4
5
6
7
{
  "enabled": true,
  "list": [
    "email1@example.com",
    "example.com"
  ]
}

Response

1
2
3
4
5
6
7
8
HTTP/1.1 200
{
  "enabled": true,
  "list": [
    "email1@example.com",
    "example.com"
  ]
}

Footer設定の取得 [GET]

Request

1
GET https://api.sendgrid.com/v3/mail_settings/footer HTTP/1.1

Response

1
2
3
4
5
6
HTTP/1.1 200
{
  "enabled": true,
  "html_content": "...",
  "plain_content": "..."
}

Footer設定の更新 [PATCH]

Request

1
PATCH https://api.sendgrid.com/v3/mail_settings/footer HTTP/1.1
Request Body
1
2
3
4
5
{
  "enabled": true,
  "html_content": "...",
  "plain_content": "..."
}

Response

1
2
3
4
5
6
HTTP/1.1 200
{
  "enabled": true,
  "html_content": "...",
  "plain_content": "..."
}

Forward Spam設定の取得 [GET]

Request

1
GET https://api.sendgrid.com/v3/mail_settings/forward_spam HTTP/1.1

Response

1
2
3
4
5
HTTP/1.1 200
{
  "enabled": true,
  "email": "email address"
}

Forward Spam設定の更新 [PATCH]

Request

1
PATCH https://api.sendgrid.com/v3/mail_settings/forward_spam HTTP/1.1
Request Body
1
2
3
4
{
  "enabled": true,
  "email": "email address"
}

Response

1
2
3
4
5
HTTP/1.1 200
{
  "enabled": true,
  "email": "email address"
}

HTML変換設定の取得 [GET]

Request

1
GET https://api.sendgrid.com/v3/mail_settings/plain_content HTTP/1.1

Response

1
2
3
4
HTTP/1.1 200
{
  "enabled": true
}

HTML変換設定の更新 [PATCH]

Request

1
PATCH https://api.sendgrid.com/v3/mail_settings/plain_content HTTP/1.1
Request Body
1
2
3
{
  "enabled": true
}

Response

1
2
3
4
HTTP/1.1 200
{
  "enabled": true
}

Spam Check設定の取得 [GET]

max_score 1〜10

Request

1
GET https://api.sendgrid.com/v3/mail_settings/spam_check HTTP/1.1

Response

1
2
3
4
5
6
HTTP/1.1 200
{
  "enabled": true,
  "url": "url",
  "max_score": 5
}

Spam Check設定の更新 [PATCH]

max_score 1〜10 url URLまたはメールアドレス

Request

1
PATCH https://api.sendgrid.com/v3/mail_settings/spam_check HTTP/1.1
Request Body
1
2
3
4
5
{
  "enabled": true,
  "url": "url",
  "max_score": 5
}

Response

1
2
3
4
5
6
HTTP/1.1 200
{
  "enabled": true,
  "url": "url",
  "max_score": 5
}

Template設定の取得 [GET]

Request

1
GET https://api.sendgrid.com/v3/mail_settings/template HTTP/1.1

Response

1
2
3
4
5
HTTP/1.1 200
{
  "enabled": true,
  "html_content": "<% body %>"
}

Template設定の更新 [PATCH]

Request

1
PATCH https://api.sendgrid.com/v3/mail_settings/template HTTP/1.1
Request Body
1
2
3
4
{
  "enabled": true,
  "html_content": "<% body %>"
}

Response

1
2
3
4
5
HTTP/1.1 200
{
  "enabled": true,
  "html_content": "<% body %>"
}

Bounce Purge設定の取得 [GET]

hard_bouncesとsoft_bouncesに設定可能な値は正の整数のみです。

Request

1
GET https://api.sendgrid.com/v3/mail_settings/bounce_purge HTTP/1.1

Response

1
2
3
4
5
6
HTTP/1.1 200
{
  "enabled": true,
  "hard_bounces": 5,
  "soft_bounces": 5
}

Bounce Purge設定の更新 [PATCH]

hard_bouncesとsoft_bouncesに設定可能な値は正の整数のみです。

Request

1
PATCH https://api.sendgrid.com/v3/mail_settings/bounce_purge HTTP/1.1
Request Body
1
2
3
4
5
{
  "enabled": true,
  "hard_bounces": 5,
  "soft_bounces": 5
}

Response

1
2
3
4
5
6
HTTP/1.1 200
{
  "enabled": true,
  "hard_bounces": 5,
  "soft_bounces": 5
}

Forward Bounce設定の取得 [GET]

Request

1
GET https://api.sendgrid.com/v3/mail_settings/forward_bounce HTTP/1.1

Response

1
2
3
4
5
HTTP/1.1 200
{
  "enabled": true,
  "email": "email address"
}

Forward Bounce設定の更新 [PATCH]

Request

1
PATCH https://api.sendgrid.com/v3/mail_settings/forward_bounce HTTP/1.1
Request Body
1
2
3
4
{
  "enabled": true,
  "email": "email address"
}

Response

1
2
3
4
5
HTTP/1.1 200
{
  "enabled": true,
  "email": "email address"
}