UNPKG

mailosaur

Version:

The Mailosaur Node library lets you integrate email and SMS testing into your continuous integration process.

20 lines (17 loc) 655 B
const MessageAddress = require('./messageAddress'); class MessageSummary { constructor(data = {}) { this.id = data.id; this.type = data.type; this.server = data.server; this.from = (data.from || []).map((i) => (new MessageAddress(i))); this.to = (data.to || []).map((i) => (new MessageAddress(i))); this.cc = (data.cc || []).map((i) => (new MessageAddress(i))); this.bcc = (data.bcc || []).map((i) => (new MessageAddress(i))); this.received = new Date(data.received); this.subject = data.subject; this.summary = data.summary; this.attachments = data.attachments || 0; } } module.exports = MessageSummary;