This is a great question. There are a few of solutions that I can think of:
1. Journey Builder
If Journey Builder is enabed on your account then you could create a Journey with a Salesforce Data Event.
From your email, you could then retrieve other Attributes that you defined in your event using the RetrieveSalesforceObjects()
AMPscript function using colon notation as detailed in this answer.
2. Add Subscriber Profile Attributes
A Triggered Send request from Sales Cloud uses Marketing Cloud's messageDefinitionSends REST API method. REST API method. It turns out that several other fields are included in the request payload.
If you review the Triggered Send logs in Sales Cloud, you will see the raw payload request made to Marketing Cloud. Logs are located under Documents tab in Sales Cloud, under Marketing Cloud Documents folder:
*****2017-06-25 23:01:49.991|LOG STARTED
*****2017-06-25 23:01:49.991|HTTP CALLOUT|SingleSyncSubscriber
*****2017-06-25 23:01:50.69|HTTP REQUEST|https://rest.s7.exacttarget.com/rest/beta/integration/subscriber/synchronization/single/ {"source":{"salesforce":{"version":"5.0","subscriber":{"type":"contact","key":"00328000016OkOOAA0"},"properties":[{"value":"false","name":"HonorEmailOptOut"}],"channel":"Email"}}}
*****2017-06-25 23:01:50.88|HTTP RESPONSE|{"hasWarnings":false,"subscriberData":[{"name":"Id","value":"00328000016OkOOAA0"},{"name":"EmailAddress","value":"[email protected]"},{"name":"SFOrgId","value":"00D28000001HqWBEA0"},{"name":"AlternateKey","value":"00328000016OkOOAA0"},{"name":"Email Address","value":"[email protected]"},{"name":"First Name","value":"Test"},{"name":"Last Name","value":"sam3"},{"name":"Organisation","value":"sam2 and sam3 Household"},{"name":"Diagnosis","value":"false"},{"name":"Biobank","value":"false"}],"hasError":false}
*****2017-06-25 23:01:50.905|HTTP CALLOUT|ExecuteTriggeredSend
*****2017-06-25 23:01:50.923|HTTP REQUEST|https://www.exacttargetapis.com/messaging/v1/messageDefinitionSends/7eadead7-8651-e711-8a02-1402ec67ad30/send {"From":{"Address":null,"Name":null},"To":{"Address":"[email protected]","SubscriberKey":"00328000016OkOOAA0","ContactAttributes":{"SubscriberAttributes":{"EmailAddress":"[email protected]","SFOrgId":"00D28000001HqWBEA0","AlternateKey":"00328000016OkOOAA0","Email Address":"[email protected]","First Name":"Test","Last Name":"sam3","Organisation":"Acme LLC","Diagnosis":"false","Current":"false","SObject":"CampaignMember","RecordId":"00v28000009MRapAAG"}}}}
*****2017-06-25 23:01:50.937|HTTP RESPONSE|{"requestId":"250ff420-845a-4016-a09e-d9691c228365","responses":[{"recipientSendId":"250ff420-845a-4016-a09e-d9691c228365","hasErrors":false,"messages":["Queued"]}]}
If you inspect the Subscriber Attributes object, you will see the attributes that are passed to Marketing Cloud by the Triggered Send. You can then create nullable Subscriber Attributes in Marketing Cloud (Email App > Subscribers > Profile Management) with matching names and the values will be stored agains the subscriber, which can then be retrieved using AMPscript in your email. For example:
set @recordId = AttributeValue('RecordId')
3. Triggered Send REST API
The other option would be to use the HttpRequest Apex Class to make a request to Marketing Cloud's messageDefinitionSends REST API method.
You would first need to create a Data Extension using the 'Create From Template' option and selecting the 'TriggeredSendDataExtension' template. Add the fields that you want to capture from your Trigged Send, for example: CampaignId
, HasResponded
, etc.
Then, when you create your Triggered Send in Marketing Cloud, in the Subscriber Management section, uncheck the 'Add Subscribers to this list' option list and select the "Triggered Send" Data Extension that you created.
When a triggering API request is made, a row is added to the Triggered Sends DE for each recipient contained in the request. Note that your SubscriberAttributes must include all required fields of the data extension that don't have a default value.
In your email, you can then use the Lookup or LookupRows AMPscript functions to retrieve the values from the Triggered Send DE you created.
Here's a sample request payload for your messageDefinitionSends request:
{
"From":{
"Address":"[email protected]",
"Name":"no reply"
},
"To":{
"Address":"[email protected]",
"SubscriberKey":"00330000000xEftMGH",
"ContactAttributes":{
"SubscriberAttributes":{
"CampaignId":"00330000000xEftmgh",
"HasResponded":true,
"FirstName":"Simon",
"LastName":"Sausage",
"LeadOrContactId":"001000000000AbCd"
}
}
}
}