How do I pass data to an email via a triggered send?

I’m trying to send a triggered send as is explained here:

I’m trying to display content from the web service in the email via AMPscript as is explained here:

It’s not working though. How do I access the attribute values from the triggered send web service in the actual email within the AMPscript? Here is my web service call:

$myclient = new ET_Client();
$triggeredsend = new ET_TriggeredSend();
$triggeredsend->authStub = $myclient;
$triggeredsend->props = array('CustomerKey' => $customerkey);
$triggeredsend->subscribers = array(array(
    'EmailAddress' => $email, 
    'SubscriberKey' => $email, 
    'Attributes' => array('Name' => 'maxTransport', 'Value' => $maxTransport)

$results = $triggeredsend->send();

And here is how I’m trying to display the variable in my email:

Max Transport = %%maxTransport%%

But the variable is not showing up, and I get a validation error for my email that says:

Errors found in the email HTML Body. Category : Substitution String
Personalization error:%%maxtransport%% To fix the problem, please try
the following: Make sure that there is not a space or typo within the
personalization string in your email. For example, check and correct
any spaces between percent signs (%%)


Thank you for visiting the Q&A section on Magenaut. Please note that all the answers may not help you solve the issue immediately. So please treat them as advisements. If you found the post helpful (or not), leave a comment & I’ll get back to you as soon as possible.

Method 1

Welcome to SFSE!

Do you have a maxTransport column in the target Data Extension configured in your Triggered Send Definition? If not, you’ll need one.

It’s a good practice to wrap personalization strings with the AttributeValue() function in your email. Make sure to include the double-quotes around the attribute name. For example:


var @maxTransport
set @maxTransport = AttributeValue("maxTransport")

<br>maxTransport: %%=v(@maxTransport)=%%

If you use the AttributeValue() function, you can check if it’s undefined or empty using the empty() function, e.g:


if not empty (@maxTransport) then 
  outputLine(concat("maxTransport: ",@maxTransport))
  outputLine(concat("maxTransport is empty"))


Method 2

For others, I thought I’d post my answer to a similar question on how to do this specifically with ExactTarget and PHP:

All methods was sourced from or, is licensed under cc by-sa 2.5, cc by-sa 3.0 and cc by-sa 4.0

0 0 votes
Article Rating
Notify of

Inline Feedbacks
View all comments
Would love your thoughts, please comment.x