Skip to content

Instantly share code, notes, and snippets.

@johnnadeau
Last active August 29, 2015 14:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save johnnadeau/d58a7ca57d6f922a6c61 to your computer and use it in GitHub Desktop.
Save johnnadeau/d58a7ca57d6f922a6c61 to your computer and use it in GitHub Desktop.
Just a roughed out example of the structure we can use for the trigger system...
using System;
using System.Collections.Generic;
namespace Trigger
{
public class TriggerEvent
{
public int Id;
public TriggerEventType Type;
public DateTime EventDateTime; //UTC plz'
public int OrderId;
public Guid TransactionId;
public string EventData; //json object? would be the data
}
public enum TriggerEventType
{
EmailClick = 0,
EmailOpen = 1,
EmailForward = 2,
//EmailUnopen = 3,
//EmailReply = 4,
EmailBounce = 5,
SMSReply = 6,
SMSBounce = 7,
VoiceHotKey = 8,
VoiceBounce = 9
}
public class Trigger
{
public int Id;
public bool Global; //flag if the trigger is a global trigger
//(ie. SMS replies should all pass through our system to be stored and checked for a 'Stop' request)
public int AccountId;
public int ContactId;
public in OrderId;
public List<TriggerEventType> TriggerEventTypes; //do we want to allow for multiple trigger event types to be associated with a trigger
public string WebhookUrl; //url we'll be posting to
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment