Skip to content

Instantly share code, notes, and snippets.

@sendpulse
Last active August 1, 2017 17:17
Show Gist options
  • Save sendpulse/3dd961a6ed421af2f4b4 to your computer and use it in GitHub Desktop.
Save sendpulse/3dd961a6ed421af2f4b4 to your computer and use it in GitHub Desktop.
SendPulse REST API Usage Example for Ruby https://github.com/sendpulse/sendpulse-rest-api-ruby
# SendPulse's Ruby Library: https://github.com/sendpulse/sendpulse-rest-api-ruby
require './api/sendpulse_api'
sendpulse_api = SendpulseApi.new(API_CLIENT_ID, API_CLIENT_SECRET, API_PROTOCOL, API_TOKEN)
email = {
html: '<p>Your email content goes here<p>',
text: 'Your email text version goes here',
subject: 'Testing SendPulse API',
from: { name: 'Your Sender Name', email: 'your-sender-email@gmail.com' },
to: [
{
name: "Subscriber's name",
email: 'subscriber@gmail.com'
}
]
}
sendpulse_api.smtp_send_mail(email)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment