One of my clients are looking to bring a photo of a group in their email. This photo depends on the value of the group that is mentioned in a data extension.
I have written the amp script for this & looks like the amp script evaluates correctly the Key referenced in the ContentBlockbyKey by it fails when I do the send preview. I do have the content block with that specific key that matches the group value.
Please see the print screens attached. Script I wrote is below:
%%[ var @firstname,@group SET @firstname=[First_Name] SET @rows=LookupOrderedRows('FirstNamesDe2',0,'GroupID desc','ContactID',ContactID) SET @rowcount=RowCount(@rows) if @rowcount>0 then for @i=1 to @rowcount do set @row=row(@rows,@i) set @firstname=field(@row,"First_Name") set @group=field(@row,"GroupID")]%% %%=ContentBlockbyKey(@group)=%% %%[next @i endif ]%% <br> %%=v(@firstname)=%% <br> %%=v(@group)=%% <br>
Any idea is appreciated.