I am trying to add the order number to an email subject and I don't know-how. Plus I am really new to the AMPscript world.

I want my email subject to be like: ''Your #OrderID is on the go''

for the moment I went here and choose the Data Extension and then the field that I wanted to be mapped

AMPscript in subjectline

Can you please advise?

  • 1
    And did it work?
    – zuzannamj
    Jul 21 at 16:40

I'd recommend adding an AMPscript block at beginning of your email body and setting the subject there:


var @subject
var @idCommanda
set @idCommanda = AttributeValue("idCommanda") /* check if this send context attribute has a value */

if not empty(@idCommanda) then
  set @subject = concat("Comanda ta #", @idCommanda, " fost expidiata")
  set @subject = concat("Comanda ta fost expidiata")


Then in the Subject field:

  • Works perfectly. Thank you so much. Jul 22 at 12:02

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.