Last active
December 13, 2015 17:49
-
-
Save mranosa/4951025 to your computer and use it in GitHub Desktop.
send email
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
'use strict'; | |
trippingIronmanApp.controller('ContactCtrl', ['$scope', '$http', function($scope, $http) { | |
$scope.email = { | |
name : '', | |
email : '', | |
message : '' | |
}; | |
$scope.sendEmail = function(){ | |
console.log('test'); | |
$http.defaults.headers.post['Accept'] = 'application/json'; | |
$http.defaults.headers.post['Content-Type'] = 'application/json'; | |
$http.defaults.headers.post['X-Postmark-Server-Token'] = 'token'; | |
$http.post('http://api.postmarkapp.com/email', { | |
From: 'sender@example.com', | |
To: 'mark.ranosa@gmail.com', | |
Subject: 'Postmark test', | |
HtmlBody: '<html><body><strong>Hello</strong> dear Postmark user.</body></html>' | |
}).success(function(callback){ | |
console.log(callback); | |
}); | |
}; | |
}]); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment