Send emails through Mailgun. Cross domain is enabled for the allowed domains.
POST /contact - send emails, requires name, email, phone and message params
POST /subscribe - subscribe to mailing list, requires address param
ALLOWED_DOMAIN
MAILGUN_API_TOKEN
MAINGUN_RECEIVER
MAINGUN_DOMAIN
MAILGUN_MAILING_LIST
Send email
$.ajax({
type: 'POST',
url: 'http://localhost:4567/contact',
data: { name: '', email: '', phone: '', message: '' },
success: function() {
doSomething();
}
});
Subscribe to mailing list
$.ajax({
type: 'POST',
url: 'http://localhost:4567/subscribe',
data: { address: 'foo@bar.com' },
success: function() {
doSomething();
}
});
$ git clone git@github.com:jaya/zeca.git
$ cd zeca
$ bundle install
$ ruby app.rb