Yes it is possible.
Once the triggered send is defined you can use the body of the request to send the attributes.
Here is some pseudo code examples of it:
Object Definitions
/*******************************************
*
* Message Send Classes
*
*******************************************/
public class messageSendBody{
public To To {get;set;}
public messageSendBody(Id oId){
Opportunity o = [Select
....Your Fields Here........
From Opportunity Where Id = :oId];
SubscriberAttributes attr = New SubscriberAttributes();
attr.Offer = o.Offer__c;
attr.offerID = o.Offer_ID__c;
attr.billing_First_Name = o.FIELDAPINAME;
attr.billing_Last_Name = o.FIELDAPINAME;
attr.billing_Email = o.FIELDAPINAME;
attr.Customer_Loyalty_Number = o.FIELDAPINAME;
To = New To(attr.billing_email,attr);
}
}
public class messageStatus{
public dateTime deliveryTime {get;set;}
public string id {get;set;}
public string messageId {get;set;}
public string status {get;set;}
public To to {get;set;}
public messageErrors[] messageErrors {get;set;}
}
public class To{
public string Address {get;set;}
public string SubscriberKey {get;set;}
public ContactAttributes ContactAttributes {get;set;}
public To(String a, SubscriberAttributes sa){
Address = a;
SubscriberKey = a;
ContactAttributes = New ContactAttributes(sa);
}
}
public class ContactAttributes{
public SubscriberAttributes SubscriberAttributes {get;set;}
public ContactAttributes(SubscriberAttributes s){
SubscriberAttributes = s;
}
}
public class SubscriberAttributes{
public String Offer {get;set;}
public String Billing_First_Name {get;set;}
public String Billing_Last_Name {get;set;}
public String Billing_Email {get;set;}
public String Billing_Company {get;set;}
public String Billing_Address {get;set;}
public String Billing_Address_Line_2 {get;set;}
public String Billing_Zip_Postal {get;set;}
public String Customer_Loyalty_Number {get;set;}
public String Purchased_Product {get;set;}
public String Price_Paid {get;set;}
public String New_Expiration_Date {get;set;}
public String OfferID {get;set;}
public String Key {get;set;}
}
To send you do the regular authentication stuff and do something line this in the code:
HTTPRequest req = New HTTPRequest();
req.setBody(JSON.SerializePretty(
new messageSendBody(oppId)
)
);
How you structure your classes and methods is up to your processes. The important part is the To
class and the SubscriberAttributes