0
votes

I have a ScriptTask that assigns values of nodes from an XML email template to SSIS package variables. I then use those variables in a SendMailTask. In the SendMailTask, when I create the following expression for the MessageSource field:

"There was an error in processing order #" + @[User::ErrorOrderId] + " for the vendor " + @[User::ErrorVendorName]  + "."

I get the result in the email body:

There was an error in processing order #000000 for the vendor Acme.

This is the output that I want. But when I add the same expression to an XML email template, and in a ScriptTask assign that expression to the variable @[User::EmailErrorMessage]. In the SendMailTask Expression I assign the MessageSource field that variable, the output in the email is the string literal without and parameters being replaced:

"There was an error in processing order #" + @[User::ErrorOrderId] + " for the vendor " + @[User::ErrorVendorName]  + "."

My question is, is there a way to pass an SSIS Expression as a variable?

1

1 Answers

0
votes

Set the EvaluateAsExpression property to True on the variable you're assigning to @[User::EmailErrorMessage]. (Select the variable in the Variables window and then check the Properties window.)