Skip to content

Commit

Permalink
Merge pull request #409 from conveyal/dev
Browse files Browse the repository at this point in the history
Fix Spark Transmissions
  • Loading branch information
trevorgerhardt authored Jun 8, 2017
2 parents 16f1cc1 + 23252eb commit 7b597bc
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 15 deletions.
3 changes: 3 additions & 0 deletions client/service-alerts-view/style.css
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@

.ServiceAlerts {
background-color: #f2dede;
}

.ServiceAlert {
padding: 8px;
}

Expand Down
32 changes: 17 additions & 15 deletions lib/spark.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,21 +47,23 @@ module.exports.send = function send (options, callback, template) {
}
}

spark.transmissions.send({
transmissionBody: {
content: {
from: { email: config.email.address, name: config.email.name },
html: template(options),
subject: options.subject
},
options: {
click_tracking: true,
open_tracking: true,
transactional: true
},
recipients: [{address: options.to}]
}
}, (err, response) => {
const html = template.render(options)
const transmission = {
content: {
from: { email: config.email.address, name: config.email.name },
html,
subject: options.subject,
text: html
},
options: {
click_tracking: true,
open_tracking: true,
transactional: true
},
recipients: [{address: options.to}]
}

spark.transmissions.send(transmission, (err, response) => {
if (err) {
callback(err)
} else {
Expand Down

0 comments on commit 7b597bc

Please sign in to comment.