0

If 0 photos subject line:

Are potential customers seeing the best of %%Business_Name__c%%?

If > 1 photos subject line:

See who’s posting photos of %%Business_Name__c%% on XYZ

If no business name name subject line:

See who’s posting photos of your business on XYZ

Not sure the best way to solve this in AMPscript. My code:

%%[

IF (Number_of_Photos__c == 0 AND NOT EMPTY(Business_name__C)) THEN

  set @subjectline =  Concat("Are Potential cusomters seeing the best of ",Business_name__c, "?")

ELSE IF Business_name__C is not empty THEN

  set @subjectline = Concat("See whose posting photos of", Business_name__c," on XYZ")

ELSE

  set @subjectline = See Who's posting photos of your business on XYZ

ENDIF
]%%
1
  • Have you tried your code? If so, please post the error you're getting. May 8, 2018 at 22:22

1 Answer 1

1

Beyond the syntax issues, I'd approach the logic differently:

%%[

var @busName
var @numPhotos
set @busName = AttributeValue("Business_name__c")
set @numPhotos = AttributeValue("Number_of_Photos__c")

if not empty(@busname) then

  if empty(@numPhotos) or @numPhotos == 0 then

    set @subjectline =  concat("Are potential customers seeing the best of ", @busName, "?")

  else

    set @subjectline = concat("See who's posting photos of ", @busName, " on XYZ")

  endif

else

   set @subjectline = "See who's posting photos of your business on XYZ"

endif


]%%
1
  • Hi Adam! Thanks for your help. This worked. My error was an unbound IF statement. can you help me understand why you approached it in your manner? trying to improve my thought process through these problems
    – Aaron
    May 9, 2018 at 22:44

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .