POST api/sys/email/sendGrid?accoutType={accoutType}

郵件發送(第三方接口)

Request Information

URI Parameters

NameDescriptionTypeAdditional information
accoutType

string

Default value is default

Body Parameters

SendGridContract
NameDescriptionTypeAdditional information
personalizations

Collection of Personalizations

None.

from

EmailAddress

None.

reply_to

EmailAddress

None.

subject

string

None.

content

Collection of EmailContent

None.

attachments

Collection of GridAttachment

None.

Request Formats

application/json, text/json

Sample:
{
  "personalizations": [
    {
      "to": [
        {
          "email": "sample string 1",
          "name": "sample string 2"
        },
        {
          "email": "sample string 1",
          "name": "sample string 2"
        }
      ],
      "cc": [
        {
          "email": "sample string 1",
          "name": "sample string 2"
        },
        {
          "email": "sample string 1",
          "name": "sample string 2"
        }
      ],
      "bcc": [
        {
          "email": "sample string 1",
          "name": "sample string 2"
        },
        {
          "email": "sample string 1",
          "name": "sample string 2"
        }
      ],
      "subject": "sample string 1"
    },
    {
      "to": [
        {
          "email": "sample string 1",
          "name": "sample string 2"
        },
        {
          "email": "sample string 1",
          "name": "sample string 2"
        }
      ],
      "cc": [
        {
          "email": "sample string 1",
          "name": "sample string 2"
        },
        {
          "email": "sample string 1",
          "name": "sample string 2"
        }
      ],
      "bcc": [
        {
          "email": "sample string 1",
          "name": "sample string 2"
        },
        {
          "email": "sample string 1",
          "name": "sample string 2"
        }
      ],
      "subject": "sample string 1"
    }
  ],
  "from": {
    "email": "sample string 1",
    "name": "sample string 2"
  },
  "reply_to": {
    "email": "sample string 1",
    "name": "sample string 2"
  },
  "subject": "sample string 1",
  "content": [
    {
      "type": "sample string 1",
      "value": "sample string 2"
    },
    {
      "type": "sample string 1",
      "value": "sample string 2"
    }
  ],
  "attachments": [
    {
      "Type": "sample string 1",
      "Content": "sample string 2",
      "FileName": "sample string 3"
    },
    {
      "Type": "sample string 1",
      "Content": "sample string 2",
      "FileName": "sample string 3"
    }
  ]
}

application/x-www-form-urlencoded

Sample:

Failed to generate the sample for media type 'application/x-www-form-urlencoded'. Cannot use formatter 'JQueryMvcFormUrlEncodedFormatter' to write type 'SendGridContract'.

Response Information

Resource Description

郵件發送(第三方接口)

ReturnResultOfBoolean
NameDescriptionTypeAdditional information
data

boolean

None.

code

状态码:100成功,其他自定义

integer

None.

message

提示消息

string

None.

Response Formats

application/json, text/json

Sample:
{
  "data": true,
  "code": 2,
  "message": "sample string 3"
}