[SalesForce] Creating triggered send without a data extension

Theoretically it should be possible to create a Triggered Send without an underlying Triggered Send Data Extension. The JSON passed to messageDefinitionSends REST call should still be available to the email, where it can be parsed. The latter probably through a combination of SSJS and AmpScript. I have been trying to find examples of this approach, but unfortunately without any luck.

Does any of you have succeeded in building triggered sends without data extension, and with JSON from the messageDefinitionSends call parsed directly in the email? Is there any ressource out there describing this approach?

Thank you
Brgds
Lukas

Best Answer

You can achieve this when creating a triggered send definition under Email Studio -> Interactions -> Triggered Emails. There you need to select the All Subscribers list under "Subscriber Management".

Then you can trigger the send using the API and the key of the created triggered send:

/messaging/v1/messageDefinitionSends/key:[external key of your triggered send]/send

You need to supply the data you like to process in the body of the request sent to the api under To.ContactAttributes.SubscriberAttributes:

{
    "From": {
        "Address": "from@yourdomain.com",
        "Name": "yourname"
    },
    "To": {
        "Address": "subscriber@domain.com",
        "SubscriberKey": "SUBSCRIBERKEY",
        "ContactAttributes": {
            "SubscriberAttributes": {
                "YourAttribute": "DATA"
            }
        }
    }
}

Then you can use the data in the triggered email using the following AMPscript-code:

Var @YourAttribute
Set @YourAttribute = AttributeValue("YourAttribute")
Related Topic