I believe the only two ways to do this are to:
- Create a Data Extension or List with just the single individual
- Create the email as a Triggered Send Definition and initiate that way.
For 1 - there are ways to create Data Extensions and insert records via the API or SSJS Core library that can allow you to automate this process.
SSJS: Add
var deObj = {
"CustomerKey" : "demoDE",
"Name" : "My Demo DE",
"Fields" : [
{ "Name" : "Field 1", "FieldType" : "Number", "IsPrimaryKey" : true, "IsRequired" : true },
{ "Name" : "Field 2", "FieldType" : "Text", "MaxLength" : 50 },
{ "Name" : "Field 3", "FieldType" : "Date", "Ordinal" : 2 },
]
};
var myDE = DataExtension.Add(deObj);
SSJS: Rows.Add
var birthdayDE = DataExtension.Init("birthdayDE");
birthdayDE.Rows.Add({FirstName:"Angel",LastName:"Ruiz",EmailAddress:"[email protected]",Age:24,Birthday:"11/29/1980"});
API: Create
var prox = new Script.Util.WSProxy();
var guid = Platform.Function.GUID();
var name = "my test de - " + guid;
var de = {
Name: name,
CustomerKey: guid,
Description: "Another DE added via SSJS",
Fields: [{
FieldType: "Text",
Name: "ID",
MaxLength: 36,
IsPrimaryKey: true,
IsNillable: false,
IsRequired: true
},
{
FieldType: "Text",
Name: "Name",
MaxLength: 200
}],
CategoryID: 101377
}
var res = prox.createItem("DataExtension", de);
API: Add Data to Data Extension (shown in SOAP, but can be turned into WSProxy)
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/08/addressing" xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">
<soap:Header>
<wsse:Security soap:mustUnderstand="1">
<wsse:UsernameToken wsu:Id="SecurityToken-6421ac0b-a454-42a3-99f7-a77ace024446">
<wsse:Username>XXXXX</wsse:Username>
<wsse:Password Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordText">XXXXX</wsse:Password>
</wsse:UsernameToken>
</wsse:Security>
</soap:Header>
<soap:Body>
<CreateRequest xmlns="http://exacttarget.com/wsdl/partnerAPI">
<Options/>
<Objects xsi:type="DataExtensionObject">
<PartnerKey xsi:nil="true"/>
<ObjectID xsi:nil="true"/>
<CustomerKey>Definition_Key</CustomerKey>
<Properties>
<Property>
<Name>EmailAddress</Name>
<Value>[email protected]</Value>
</Property>
<Property>
<Name>FirstName</Name>
<Value>John</Value>
</Property>
<Property>
<Name>LastName</Name>
<Value>Doe</Value>
</Property>
<Property>
<Name>PrimaryKey</Name>
<Value>PrimaryKey</Value>
</Property>
</Properties>
</Objects>
</CreateRequest>
</soap:Body>
</soap:Envelope>
For 2 - If instead of SSJS you want to go via the API route, you would need to create your TSD (also via SSJS or via API) inside of the UI. Then you just send an API call or SSJS function to send it to the desired recipient.
SSJS: TSD
var triggeredSend = TriggeredSend.Init("triggeredSend");
var status = triggeredSend.Send("[email protected]", {FirstName:"Angel", CouponCode:"AA1AF"});
REST API: TSD (There is also a SOAP Object that you can use if you want)
Host: https://www.exacttargetapis.com
POST /messaging/v1/messageDefinitionSends/key:external_key/send
Content-Type: application/json
Authorization: Bearer YOUR_ACCESS_TOKEN
{
"From": {
"Address": "[email protected]",
"Name": "Code@"
},
"To": {
"Address": "[email protected]",
"SubscriberKey": "[email protected]",
"ContactAttributes": {
"SubscriberAttributes": {
"Region": "West",
"City": "Indianapolis",
"State": "IN"
}
}
},
"Options": {
"RequestType": "ASYNC"
}
}