SendEmail

This method can be used for the following functionality: Send a custom email.

Parameters

The following URL, Headers and Parameters are required for requests to this API endpoint. Where a parameter is optional, it will be indicated. Otherwise treat all parameters as mandatory.

Headers

GET /api/ss/email HTTP/1.1
Host: demo.attackforge.com
X-SSAPI-KEY: APIKey
Content-Type: application/json
Connection: close

Query

to (string | object)

Send email To. Must be either an email as a string or an object with one field "user_id"

Example:

{
   "to": [
      "support@attackforge.com",
      {
        "user_id": "6698cbabba716055c969a658"
      }
    ]
}

cc (string | object)

CC email to. Must be either an email as a string or an object with one field "user_id"

Example:

{
   "cc": [
      "support@attackforge.com",
      {
        "user_id": "6698cbabba716055c969a658"
      }
    ]
}

bcc (string | object)

BCC email to. Must be either an email as a string or an object with one field "user_id"

Example:

{
   "bcc": [
      "support@attackforge.com",
      {
        "user_id": "6698cbabba716055c969a658"
      }
    ]
}

subject

Email subject

Example:

{
   "subject": "EMAIL SUBJECT"
}

text

Email body in plaintext

Example:

{
   "text": "EMAIL BODY IN PLAINTEXT"
}

html

Email body in html

Example:

{
   "html": "<p style=\"border: 3px solid green;\"><b>EMAIL BODY</b></p>"
}

Example

The following example is a cURL request to send daily project commencement email to project team.

Request

Include API Token instead of stars in 'X-SSAPI-KEY: ***************************************' parameter.

curl --request POST \
	--url https://localhost:3000/api/ss/email \
	--header 'content-type: application/json' \
	--header 'x-ssapi-key: ***************************************' \
	--data '{"to":["support@attackforge.com",{"user_id":"6698cbabba716055c969a658"}],"cc":["support@attackforge.com",{"user_id":"6698cbabba716055c969a658"}],"bcc":["support@attackforge.com",{"user_id":"6698cbabba716055c969a658"}],"subject":"EMAIL SUBJECT","text":"EMAIL BODY","html":"<p style=\"border: 3px solid green;\"><b>EMAIL BODY</b></p>"}'

Response

Response contains a status.

{
   "status": "Accepted"
}

Last updated