This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Example encoding of an email message in JSON | |
{ | |
headers: [ # in an array since order matters | |
{ name: 'Subject', value: 'An email' }, | |
{ name: 'Date', value: 'Thu, 4 Mar 2010 15:35:32 -0800' }, | |
{ name: 'From', value: 'george@foo.com' }, | |
{ name: 'To', value: 'paul@goo.com' } | |
{ name: 'Sender', value: 'paul@goo.com' } | |
{ name: 'Reply-to', value: 'paul@goo.com' } | |
], | |
from: 'From blah blah...', | |
body: { | |
type: 'multipart/alternative, | |
parts: [ | |
{ | |
id: 'partid-1', | |
type: 'text/plain', | |
sections: [ | |
{ | |
type: 'greeting', | |
text: 'Dear Jason,' | |
}, | |
{ | |
type: 'normal', | |
text: ["This is an ", {type: 'url', href: 'http://foo.com, text: "URL"}, ", that I have embedded in some text."] | |
}, | |
{ | |
type: quoted-section, | |
text: "Something worth quoting." | |
}, | |
{ | |
type: quoted-section, | |
body: { | |
headers: [ | |
{ name: 'Subject', value: 'Hey there' }, | |
{ name: 'Date', ... } | |
], | |
body: { | |
type: 'text/plain', | |
text: 'Hi there' | |
} | |
} | |
}, | |
{ | |
type: 'signature', | |
text: '...' | |
} | |
] | |
}, | |
{ | |
id: 'id', | |
type: 'text/html' | |
text: '<bold>Dear Jason</bold>, <br/>This is a test.', | |
}, | |
] | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment