Parse gmail API emails
var parse = require('parse-gmail-email');
var email = 'Your full gmail API email';
parse(email, function(err, data) {
// =>
/*
{
subject: 'Subject here',
from: { name: 'Steve Lacy', address: '[email protected]' },
to: [ { address: '[email protected]', name: 'Steve Lacy' } ],
cc: [
{ address: '[email protected]', name: '' }
],
id: '14b9d36df0e',
threadId: '14b9d3694f7',
labelIds: [ 'INBOX', 'CATEGORY_UPDATES' ],
snippet: 'this is a snippet',
attachments: {
'2': {
filename: 'great-websites.md', attachmentId: 'SUCHIDHERE'
}
},
message: 'This is the message'
}
*/
});