1. Feedback Actions
  2. Update From Email

Feedback Actions

Update From Email Feedback Action

A feedback action called by the email system when an email is sent to a stub

Overview

When an email is received by the Stubber Platform the stubsession is derived to intelligently route the email to the correct stub.
Then the _update_from_email feedback action is triggered on the stub.

The _update_from_email feedback action is used to then further automate anything in the stub that needs to be done when an email is received.

The message body of the email will be set to the message of the stubpost. i.e. stubpost.message.
If a contact can be derived from the email address of the sender, the posted_by => on_behalf_of will be set to the contact.
All the details of the email will be available in the stubpost.data._email_in data path.

Data Structure

Feedback Action Data

Example data that is passed to the _update_from_email feedback action:

        "data": {
  "_email_in": {
    "full_body_plain": "Hi There\r\n\r\nThis is a test message.",
    "from_address": "XXXXXXXXXXXXXXXX",
    "to_addresses": [
      "[STUBREF]@stubber.email"
    ],
    "subject": "Email Subject",
    "message": "Hi There\r<br/>This is a test message.",
    "headers": {
      "[HEADER NAME]": "[HEADER VALUE]"
    },
    "attachments": [
      {
        "fileuuid": "0f2623d4-8a70-52f5-a378-82f4424753cf",
        "filename": "stubber_icon_200px.png"
      }
    ]
  }
}

      

JSONSchema

The JSONSchema of the stubpost.data._email_in is :

        {
  "$schema": "http://json-schema.org/draft-07/schema#",
  "title": "_email_in Schema",
  "type": "object",
  "properties": {
    "full_body_plain": {
      "type": "string"
    },
    "from_address": {
      "type": "string",
      "format": "email"
    },
    "to_addresses": {
      "type": "array",
      "items": {
        "type": "string",
        "format": "email"
      },
      "minItems": 1
    },
    "subject": {
      "type": "string"
    },
    "message": {
      "type": "string"
    },
    "headers": {
      "type": "object",
      "patternProperties": {
        "^[A-Za-z0-9-]+$": {
          "type": "string"
        }
      },
      "additionalProperties": {
        "type": "string"
      }
    },
    "attachments": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "fileuuid": {
            "type": "string",
            "format": "uuid"
          },
          "filename": {
            "type": "string"
          }
        },
        "required": ["fileuuid", "filename"],
        "additionalProperties": false
      }
    }
  },
  "required": ["full_body_plain", "from_address", "to_addresses", "subject", "message"],
  "additionalProperties": true
}