0

Trying to switch out the static attachment in an email to dynamic based on a Data Extension(DE).

The Static:

%%[
%%=AttachFile("FTP","AIDI.pdf")=%%
]%%

And what I'm tried to replace it with:

%%[ var @Program,@ColumnProgramCode  set @ColumnProgramCode = Lookup("Program_Interest_G", "ProgramCode", "ProgramOfInterest", @Program)]%%
%%[
%%=AttachFile('FTP',%%@ColumnProgramCode%% +'.pdf')=%%
]%%

The DE is Program_Interest_G the filed name is ProgramCode

0

I’ve got this working great now when the @file is not empty. However when it is empty the email fails. I’ve tried an if statement but it’s not working

%%[ var @Program,@ColumnProgramCode , @file set @Program =v([Lead:Global_Program_of_Interest_2__c]) set @ColumnProgramCode = Lookup("Program_Interest_G", "ProgramCode", "ProgramOfInterest", @Program) SET @file = Concat(@ColumnProgramCode, '.pdf') ]%%

%%[IF NOT EMPTY(@file) THEN]%%

%%=AttachFile('FTP',@file)=%% 

%%[ENDIF]%%
0

Problem resolved. It had nothing to do with the ampscript. The Dynamic email criteria was not set correctly

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.