I have a code in the header which is supposed to give you a fall back content block if the country isn't any of those listed, in this case Canada which has French and English as language.

In the content area of the email which shows content I have a code which pulls a content block that should show for all countries but Canada.

I get an error message saying that it can't find the path for the content block in FR. So it's looking for the block rather than giving it the fallback I specified in the header.

Code in header:


Var @Language
Set @Language = Language

IF @Language != "DE" AND @Language != "FI" AND @Language != "FR" AND @Language != "NO" AND @Language != "PT"

set @Language="EN"
Set @Language = Language

IF @Country != "United Kingdom" OR @Country != "Austria" OR @Country != "Finland"  OR @Country != "Germany" OR @Country != "Ireland"  OR @Country != "Luxembourg"  OR @Country != "Norway" OR @Country != "Switzerland" OR @Country != "Brazil" OR @Country != "Liechtenstein" OR @Country != "Jersey" OR @Country != "Guernsey" OR @Country != "Isle of Man" 


Set @contentNetent = "ContentBlockByName(Concat("Shared Content\Betway.com\Content Blocks\Casino\Games\NevadaNight\BWC_PBV_GM_NevadaNight_",@Language,"_MGS"))"


Code in email:

%%[ SET @contentNetent = ContentBlockByName(Concat("Shared Content\Betway.com\Content Blocks\Casino\Games\DreamDate\BWC_PBV_GM_DreamDate_",@Language,"_MGS")) ]%% 

  • try moving the @contentNetent variable in the email to the header as an else statement to your if statement and also remove the double quote around contentblockbyname for the default content – Finan Nazazi Mar 15 '19 at 16:58
  • Use an Else statement to define the fallback content if the if statement conditions are not met. – Tom Callahan Mar 15 '19 at 22:02
  • @Finan The If language code is separate from this fallback content. It's just sitting in the same code block. (I tried to do VAR Language, contentNetent Set Language Set contentNetent but it errored) I've removed the double quote around contentblockbyname, I've also tried to do VAR Country, SET country as well as VAR contentNetent, SET contentNetent just before If country but it calls error for VAR contentNetent. – user65730 Mar 20 '19 at 14:13
  • @TomCallahan I've tried set contentNetent Else Endif but didn't make a difference. I've tried to remove all IF Country and instead have If Country == "Canada" THEN set contentNetent. But it doesn't give me the fallback so I must be missing something else? – user65730 Mar 20 '19 at 14:14
  • can you share the change you made that was erroring. – Finan Nazazi Mar 20 '19 at 14:44

This may be of value:


var @contentBlockName, @content, @retrieveStatus
set @contentBlockName = "Content Builder\LoyaltyGreeting_Oops" /* does not exist */
set @content = ContentBlockByName(@contentBlockName, "Random", 0, "Hello!", @retrieveStatus)


if @retrieveStatus < 0 then
  output(concat('<br><br><a href="https://limedash.com/join">Join Now</a> &raquo;'))


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.