mailtrain/shared/triggers.js
Tomas Bures 965f30cea7 Editing of triggers seems to work.
Some further fixes.
2018-08-04 15:00:37 +05:30

48 lines
No EOL
990 B
JavaScript

'use strict';
const Entity = {
SUBSCRIPTION: 'subscription',
CAMPAIGN: 'campaign'
};
const Event = {
[Entity.SUBSCRIPTION]: {
CREATED: 'created',
LATEST_OPEN: 'latest_open',
LATEST_CLICK: 'latest_click'
},
[Entity.CAMPAIGN]: {
DELIVERED: 'delivered',
OPENED: 'opened',
CLICKED: 'clicked',
NOT_OPENED: 'not_opened',
NOT_CLICKED: 'not_clicked'
}
};
const EntityVals = {
subscription: 'SUBSCRIPTION',
campaign: 'CAMPAIGN'
};
const EventVals = {
[Entity.SUBSCRIPTION]: {
created: 'CREATED',
latest_open: 'LATEST_OPEN',
latest_click: 'LATEST_CLICK'
},
[Entity.CAMPAIGN]: {
delivered: 'DELIVERED',
opened: 'OPENED',
clicked: 'CLICKED',
not_opened: 'NOT_OPENED',
not_clicked: 'NOT_CLICKED'
}
};
module.exports = {
Entity,
Event,
EntityVals,
EventVals
};