Sha256: c10382494719f2cc2ab55d3eb5744cef0af32f88ca41daa8bea3781586104d40

Contents?: true

Size: 1.05 KB

Versions: 3

Compression:

Stored size: 1.05 KB

Contents

require 'marketingcloudsdk'
require_relative 'sample_helper'

begin
	myclient = MarketingCloudSDK::Client.new auth
	
	TriggeredSendCustomerKey = "TEXTEXT"
	AltTriggeredSendCustomerKey = "FailTest"
	SubscriberEmailAddress = "SDKExample@bh.exacttarget.com"
	
	# Call SendTriggeredSends which can be used to send emails to multiple definitions with a single request
	# Limit usage to 50 subscribers per request. 
	tsOne = {"CustomerKey" => TriggeredSendCustomerKey}
	tsOne['Subscribers'] = [{"EmailAddress"=>SubscriberEmailAddress, "SubscriberKey" => SubscriberEmailAddress}]
	tsTwo = {"CustomerKey" => AltTriggeredSendCustomerKey}
	tsTwo['Subscribers'] = [{"EmailAddress"=>SubscriberEmailAddress, "SubscriberKey" => SubscriberEmailAddress}]
	
	response = myclient.SendTriggeredSends([tsOne,tsTwo])
	p 'Response Status: ' + response.status.to_s
	p 'Code: ' + response.code.to_s
	p 'Message: ' + response.message.to_s	
	p 'Results Length: ' + response.results.length.to_s
	p 'Results: ' + response.results.to_s
	
rescue => e
	p "Caught exception: #{e.message}"
	p e.backtrace
end


Version data entries

3 entries across 3 versions & 2 rubygems

Version Path
sfmc-fuelsdk-ruby-1.3.1 samples/sample-SendTriggeredSends.rb
sfmc-fuelsdk-ruby-1.1.0 samples/sample-SendTriggeredSends.rb
dragostsesdk-1.1.0 samples/sample-SendTriggeredSends.rb