2
1
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2023-12-13 21:00:40 +01:00

Mail API fixes

- The mail API endpoints weren't quite working correctly. Now working but still need love
This commit is contained in:
Hannah Wolfe 2014-06-03 12:31:14 +01:00
parent da04c5d6b3
commit 4b6f8ce06d

View file

@ -15,6 +15,8 @@ mail = {
return mailer.send(postData.mail[0].message)
.then(function (data) {
delete postData.mail[0].options;
// Sendmail returns extra details we don't need and that don't convert to JSON
delete postData.mail[0].message.transport;
postData.mail[0].status = {
message: data.message
};
@ -27,18 +29,22 @@ mail = {
// #### SendTest
// **takes:** nothing
sendTest: function () {
// **returns:** a promise
var html = '<p><strong>Hello there!</strong></p>' +
'<p>Excellent!' +
' You\'ve successfully setup your email config for your Ghost blog over on ' + config().url + '</p>' +
'<p>If you hadn\'t, you wouldn\'t be reading this email, but you are, so it looks like all is well :)</p>' +
'<p>xoxo</p>' +
'<p>Team Ghost<br>' +
'<a href="https://ghost.org">https://ghost.org</a></p>',
payload = {mail: [{
message: {
subject: 'Test Ghost Email',
html: html
}
}]};
return mail.send({
subject: 'Test Ghost Email',
html: '<p><strong>Hello there!</strong></p>' +
'<p>Excellent! You\'ve successfully setup your email config for your Ghost blog over on ' + config().url + '</p>' +
'<p>If you hadn\'t, you wouldn\'t be reading this email, but you are, so it looks like all is well :)</p>' +
'<p>xoxo</p>' +
'<p>Team Ghost<br>' +
'<a href="https://ghost.org">https://ghost.org</a></p>'
});
return mail.send(payload);
}
};
module.exports = mail;