Skip to content

Instantly share code, notes, and snippets.

@tylergaw
Last active October 22, 2016 03:30
Show Gist options
  • Save tylergaw/5ba51a36eae7bd290c4e27e5efde4c2b to your computer and use it in GitHub Desktop.
Save tylergaw/5ba51a36eae7bd290c4e27e5efde4c2b to your computer and use it in GitHub Desktop.
{
    "$schema": "http://json-schema.org/draft-04/schema#",
    "type": "object",
    "additionalProperties": false,
    "title": "Supporters schema",
    "description": "Used to hold supporter identity and marketing attribution information",
    "properties": {
        "email": {
            "type": "string", 
            "format": "email"
        },
        "givenName": {
            "type": ["string", "null"]
        },
        "familyName": {
            "type": ["string", "null"]
        },
         "phone": {
            "type": ["string", "null"]
        },
        "address1": {
            "type": ["string", "null"]
        },
        "address2": {
            "type": ["string", "null"]
        },
         "addressCity": {
            "type": ["string", "null"]
        },
         "addressCounty": {
            "type": ["string", "null"]
        },
         "addressStateProvince": {
            "type": ["string", "null"]
        },
         "addressPostalCode": {
            "type": ["string", "null"]
        },
         "addressCountry": {
            "type": ["string", "null"]
        },
         "socialHandle": {
            "type": ["string", "null"]
        },
         "comments": {
            "type": ["string", "null"]
        },        
        "utmSource": {
            "type": ["string", "null"]
        },        
        "utmMedium": {
            "type": ["string", "null"]
        },
        "utmCampaign": {
            "type": ["string", "null"]
        },
        "utmContent": {
            "type": ["string", "null"]
        },
        "utmTerm": {
            "type": ["string", "null"]
        },
         "emailTemplate": {
            "type": ["string", "null"]
        },
         "externalId": {
            "type": ["string", "null"]
        },
         "metadata": {
            "type": ["object", "null"]
        }
    },
    "required": [
        "email"
    ],
        "hiddenFields": [
        "utmSource",
        "utmMedium",
        "utmCampaign",
        "utmContent",
        "utmTerm",
        "emailTemplate",
        "externalId",
        "metadata"
    ]
}

Example supporter signup record

{
    "schemaId": "31459fff-4a7d-4214-bc24-c08f28c2c2c8",
    "data": {
        "email": "nalesandro+{{$timestamp}}@timshel.com",
        "givenName": "Gary",
        "familyName": "Busey",
        "phone": "4155551212",
        "address1": "101 Main St",
        "address2": "Suite 666",
        "addressCity": "SF",
        "addressStateProvince": "CA",
        "addressCounty": "San Francisco",
        "addressPostalCode": "94111",
        "addressCountry": "USA",
        "socialHandle": "",
        "comments": "When I heard about all that trash in the pacific, I just had to do SOMETHING",
        "utmSource": "August Member Newsletter",
        "utmMedium": "email",
        "utmCampaign": "Summer 2016 - Clean the Pacific Gyre",
        "utmContent": "multivariate-b",
        "utmTerm": "Pinniped Love",
        "emailTemplate": "welcome.html",
        "externalId": "987654321",
        "metadata": {"beverage":"coffee"}
    }
}  
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment