I am trying to setup a Triggered Send within my Rails-5.1.1 app. It is transactional upon creating an object. I am using the Marketing Cloud SDK formally named as Fuel SDK.
Objective:
Add Subscriber Data to either List -or- Data Extension. (Both are set-up)
Send an Email to new Subscriber
I am assigning the List Name of which I would like to send to as the CustomerKey, and I would like to know if this correct?
I have a List created which a TriggeredSend is using as Subscriber management.
The error and code are below. I am positive this is not setup correctly and would like some direction. Appreciate any help.
Rails 5.1.1
Ruby 2.3.1
gem 'marketingcloudsdk'
Error
"Send Status: false"
"Code: 200"
"Message: Error"
"Result Count: 1"
"Results: [{:status_code=>\"Error\", :status_message=>\"The Triggered Send is not completely configured or in a new status. Please check Triggered Send Definition configuration.\", :ordinal_id=>\"0\", :error_code=>\"18002\", :new_id=>\"0\", :\"@xsi:type\"=>\"TriggeredSendCreateResult\"}]"
"Exception: Failure sending TriggerSend"
Function
require 'marketingcloudsdk'
def thank_you_email
begin
myclient = MarketingCloudSDK::Client.new({'client' => {'id' => ENV['SF_CLIENT_ID'],
'secret' => ENV['SF_CLIENT_SECRET']}})
sendTrig = MarketingCloudSDK::TriggeredSend.new
sendTrig.authStub = myclient
sendTrig.props = [{"CustomerKey" => "ENV['SF_TRIGGERED_SEND_EXTERNAL_KEY']",
"Subscribers" => {"EmailAddress"=>"#{self.concierge_email}",
"SubscriberKey" => "#{self.concierge_email}"},
"Attributes" => {
"concierge_email" => "#{self.concierge_email}",
"concierge_name" => "#{self.concierge_name}",
"concierge_number" => "#{self.concierge_number}"
}
}]
results = sendTrig.send
p 'Send Status: ' + results.status.to_s
p 'Code: ' + results.code.to_s
p 'Message: ' + results.message.to_s
p 'Result Count: ' + results.results.size.to_s
p 'Results: ' + results.results.inspect
raise 'Failure sending TriggerSend' unless results.success?
rescue => e
p 'Exception: ' + e.message.to_s
end
end