-
-
Save Workman/699a83bc414d0a8ff13dce30065d78af to your computer and use it in GitHub Desktop.
For raw ruby
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
# Prerequisite: `gem install socketlabs-injectionapi` | |
# Tested in Ruby 2.7.0 | |
require "socketlabs-injectionapi" | |
require "json" | |
include SocketLabs::InjectionApi | |
include SocketLabs::InjectionApi::Message | |
serverId = 123456 | |
injectionApiKey = "YourApiKey" | |
verifiedDomain = "YourDomain.com" | |
client = SocketLabsClient.new(serverId.to_s, injectionApiKey) | |
message = BasicMessage.new | |
message.subject = "Sending A Test Message" | |
message.html_body = "<html>This is the Html Body of my message.</html>" | |
message.plain_text_body = "This is the Plain Text Body of my message." | |
message.from_email_address = EmailAddress.new("no-reply@#{verifiedDomain}") | |
message.add_to_email_address(EmailAddress.new("server#{serverId}@api-welcome.socketlabs.com")) | |
response = client.send(message) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment