diff --git a/jsonpaths/com.mandrill/recipient_unsubscribed_1.json b/jsonpaths/com.mandrill/recipient_unsubscribed_1.json index 45f9637ce..66fc42e9d 100644 --- a/jsonpaths/com.mandrill/recipient_unsubscribed_1.json +++ b/jsonpaths/com.mandrill/recipient_unsubscribed_1.json @@ -24,6 +24,7 @@ "$.data.msg.state", "$.data.msg.subject", "$.data.msg.tags", - "$.data.msg.ts" + "$.data.msg.ts", + "$.data.msg.subaccount" ] } diff --git a/schemas/com.mandrill/recipient_unsubscribed/jsonschema/1-0-1 b/schemas/com.mandrill/recipient_unsubscribed/jsonschema/1-0-1 new file mode 100644 index 000000000..386f34b9c --- /dev/null +++ b/schemas/com.mandrill/recipient_unsubscribed/jsonschema/1-0-1 @@ -0,0 +1,97 @@ +{ + "$schema": "http://iglucentral.com/schemas/com.snowplowanalytics.self-desc/schema/jsonschema/1-0-0#", + "description": "Schema for a Mandrill recipient unsubscribed event", + "self": { + "vendor": "com.mandrill", + "name": "recipient_unsubscribed", + "format": "jsonschema", + "version": "1-0-1" + }, + + "type": "object", + "properties": { + "_id": { + "type": "string" + }, + "msg": { + "type": "object", + "properties": { + "_id": { + "type": "string" + }, + "_version": { + "type": "string" + }, + "clicks": { + "type": "array", + "items": { + "type": "object", + "properties": { + "ts": { + "type": "string", + "format": "date-time" + }, + "url": { + "type": "string" + } + }, + "additionalProperties": true + } + }, + "email": { + "type": "string" + }, + "metadata": { + "type": "object", + "properties": { + "user_id": { + "type": "number" + } + }, + "additionalProperties": false + }, + "opens": { + "type": "array", + "items": { + "type": "object", + "properties": { + "ts": { + "type": "string", + "format": "date-time" + } + }, + "additionalProperties": true + } + }, + "sender": { + "type": "string" + }, + "state": { + "type": "string" + }, + "subaccount": { + "type": ["string", "null"] + }, + "subject": { + "type": "string" + }, + "tags": { + "type": "array", + "items": { + "type": "string" + } + }, + "ts": { + "type": "string", + "format": "date-time" + } + }, + "additionalProperties": false + }, + "ts": { + "type": "string", + "format": "date-time" + } + }, + "additionalProperties": false +} diff --git a/sql/com.mandrill/recipient_unsubscribed_1.sql b/sql/com.mandrill/recipient_unsubscribed_1.sql index fd7a82fe1..7f3219057 100644 --- a/sql/com.mandrill/recipient_unsubscribed_1.sql +++ b/sql/com.mandrill/recipient_unsubscribed_1.sql @@ -41,6 +41,7 @@ CREATE TABLE atomic.com_mandrill_recipient_unsubscribed_1 ( "msg.subject" varchar(255) encode raw, "msg.tags" varchar(2048) encode runlength, -- Holds a JSON array "msg.ts" timestamp encode raw, + "msg.subaccount" varchar(255) encode raw, FOREIGN KEY(root_id) REFERENCES atomic.events(event_id) ) DISTSTYLE KEY