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: '[email protected]' },
to: [
{
name: "Subscriber's name",
email: '[email protected]'
}
]
}
sendpulse_api.smtp_send_mail(email)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment