I'm trying to send an email with the Fuel SDK for C#, but am running into issues with an invalid customer key error. I've double checked my customer key is correct, perhaps there is something else I'm doing incorrectly?

Here's my attempt at coding this

ETTriggeredSendDefinition eTTriggeredSendDefinition = new ETTriggeredSendDefinition();
eTTriggeredSendDefinition.AuthStub = client;
eTTriggeredSendDefinition.Name = "DevTest";
eTTriggeredSendDefinition.CustomerKey = "ABC";
eTTriggeredSendDefinition.FromAddress = "test@example.com";
eTTriggeredSendDefinition.EmailSubject = "Test Email";
eTTriggeredSendDefinition.Email = new Email();
eTTriggeredSendDefinition.Email.HTMLBody = "%3Cb%3ESome%20HTML%20Goes%20here%3C%2Fb%3E";
eTTriggeredSendDefinition.Email.EmailType = "HTML";
eTTriggeredSendDefinition.Subscribers = new ETSubscriber[1];
eTTriggeredSendDefinition.Subscribers[0] = new ETSubscriber();
eTTriggeredSendDefinition.Subscribers[0].EmailAddress = "test@example.com";
eTTriggeredSendDefinition.Subscribers[0].Owner = new Owner();
eTTriggeredSendDefinition.Subscribers[0].Owner.FromAddress = "test@example.com";
eTTriggeredSendDefinition.Subscribers[0].Owner.FromName = "test@example.com";
SendReturn sendReturn = eTTriggeredSendDefinition.Send()
  • 1
    Hi, and welcome to SFSE! We're going to need a little more information in order to assist you. Please take a moment to read about How to Ask, then edit your post to include more information. In particular, which SDK are you using? Which API are you trying to use? The more information you give us, the better we can assist you. – sfdcfox Nov 9 '18 at 4:53
  • @sfdcfox i have edited my question. – siddharth Nov 9 '18 at 5:50
  • @siddharth is this related to salesforce? not familiar with fuel, so not clear if that's related to salesforce or not ... – Ralph Callaway Nov 9 '18 at 8:51
  • @RalphCallaway they mean FuelSDK-CSharp. It's Marketing Cloud stuff. – sfdcfox Nov 9 '18 at 14:16
  • @siddharth can you post the exact error you're getting? – Ralph Callaway Nov 20 '18 at 18:10

I was just researching this -- the "invalid customer key" means you passed an external key that is not recognized by the system.

Your example of eTTriggeredSendDefinition.CustomerKey = "ABC"; looks like the issue to me, but I'm not an API expert. Instead, find the customer key in the properties of your email or your Triggered Send.

For example, one of my keys is for email is 267a0971-0ba7-4xxx-xxxx-df6209dxxxxx (edited for privacy) and one for a triggered send is 19992 (again, edited for privacy).

These can be found in the UI

Change the customer key and give it another try.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.