0

I've got a content block that is prefaced with some AMPscript, and then tries to apply HTML styling for the actual email copy.

However, the HTML styling isn't being applied. The system default font isn't even being applied, it looks to be using the font SFMC uses for AMPscript in the Content Builder screen.

Even more confusingly, when in the builder section of Content Builder, the font displays correctly, but when previewed and proofed it doesn't. See attached screenshots.

Can anyone advise how I can update this HTML to ensure that the correct font formatting is applied?

enter image description here

The HTML I'm using is (excuse the formatting, I've tried my best!):

     <code>
        %%[SET @rows = LookupRows("Contact_Salesforce","Id", _subscriberkey) 
        SET @row = row(@rows,1) 
        SET @firstName = field(@row,"firstName") 
        SET @Mother_First_Name__c = field(@row,"Mother_First_Name__c") 
        IF NOT EMPTY(@Mother_First_Name__c) THEN ]%%</code> 

        <span style="font-size:18px; line-height:24px;font-family:Arial,Helvetica,sans-serif;">

<b>%%=v(concat(@Mother_First_Name__c, ", "))=%%%%[ELSE]%%%%[ENDIF]%%I can say with all honesty that XX changed my life.<br><br>I think XX can change %%=iif(empty(@firstName),"your student", concat(propercase(@firstName)))=%%'s life, too.</b><br><br>

        Going to XX was the best college decision I could have made for myself--but it's not where I started out. In high school, I had never heard of XX. I went to another college in XX, but as a freshman and sophomore I never felt comfortable. It wasn't the experience I was looking for....</span>

1 Answer 1

2

I'd suggest only breaking out of AMPscript blocks when there's a loop involved. It's much easier to format if you simply utilize the blocks to validate data and set variables.

%%[

SET @rows = LookupRows("Contact_Salesforce","Id", _subscriberkey) 

set @firstName = ""
set @Mother_First_Name__c = ""

if rowcount(@rows) > 0 then 

    SET @row = row(@rows,1) 
    SET @firstName = field(@row,"firstName") 
    SET @Mother_First_Name__c = field(@row,"Mother_First_Name__c") 

endif
]%%
<div style="font-size:18px; line-height:24px;font-family:sans-serif;">

    %%=iif(empty(@Mother_First_Name__c, "", concat(propercase(@Mother_First_Name__c), ", "))=%%I can say with all honesty that XX changed my life.

    <br><br>I think XX can change %%=iif(empty(@firstName),"your student", propercase(@firstName))=%%'s life, too.

    <br><br>Going to XX was the best college decision I could have made for myself--but it's not where I started out. In high school, I had never heard of XX. I went to another college in XX, but as a freshman and sophomore, I never felt comfortable. It wasn't the experience I was looking for.

</div>

You must log in to answer this question.

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