foundation-emails icon indicating copy to clipboard operation
foundation-emails copied to clipboard

Use of special characters like variables gets lowercase when compiled

Open teriyaki-89 opened this issue 5 years ago • 11 comments

Hi guys, I want to use external variables like <%=objDoc.firstname%> in the foundation that has both upper and lowercase characters but when it's compiled and inlined ready for production I get <%=objdoc.firstname%> which made everything go lowercase. I have tried to use {{{raw}}}<%=objDoc.firstname%> {{{/raw}}}} which also returns lowecase. I am not too sure wheter it's gulp, panini or inky settings that changes lettercase to lowercase and how to prevent that from happening Please, suggest any ideas.

teriyaki-89 avatar Jun 26 '20 04:06 teriyaki-89

Hi @teriyaki-89,

did you already try the code from the current develop branch? Can you provide a reproducible testcase as repository?

DanielRuf avatar Jun 26 '20 06:06 DanielRuf

I have downloaded the current developer branch and testing it there, and to provide reproducible code made a test repository

teriyaki-89 avatar Jun 26 '20 09:06 teriyaki-89

even when using online tool https://get.foundation/emails/inliner.html the <%=objDoc.firstname%> get compiled into &lt;%=objdoc.firstname%&gt;

teriyaki-89 avatar Jun 26 '20 17:06 teriyaki-89

The online inliner has not the raw support.

DanielRuf avatar Jun 26 '20 20:06 DanielRuf

I have downloaded the current developer branch <%=objDoc.firstname%> compiles to &lt;%=objDoc.firstname%&gt; {{{{raw}}}}<%=objDoc.firstname%>{{{{/raw}}}} compiles again to &lt;%=objDoc.firstname%&gt;

teriyaki-89 avatar Jul 10 '20 09:07 teriyaki-89

Can you share a repo how you used it? See https://github.com/foundation/foundation-emails-template/blob/master/src/helpers/raw.js

DanielRuf avatar Jul 10 '20 09:07 DanielRuf

Can you share a repo how you used it? See https://github.com/foundation/foundation-emails-template/blob/master/src/helpers/raw.js

Just created md file with content

<container style="border-radius: 5px;">   
    <row class="tablePaddingBottom">     
        <columns large="7" style="height: 100%; vertical-align: top;">                   
                   {{{{raw}}}}<%=objDoc.firstname%>{{{{/raw}}}}                   
        </columns>
    </row>    
</container>

Is that what you meant?

teriyaki-89 avatar Jul 10 '20 11:07 teriyaki-89

This is not a repository (GitHub project) which we can directly install and start to see the issue.

DanielRuf avatar Jul 10 '20 11:07 DanielRuf

This is not a repository (GitHub project) which we can directly install and start to see the issue.

Just pushed it all here

teriyaki-89 avatar Jul 11 '20 11:07 teriyaki-89

I'm not sure why you use the md files. Foundation Emails uses html files and you need the emails-template as described in the readme. The md files are for panini / the docs and do not use the handlebars helpers for html files. So this can not work.

Please read https://github.com/teriyaki-89/checkFoundationVars#getting-started and try the mentioned steps with a html file in the emails-template project.

DanielRuf avatar Jul 11 '20 17:07 DanielRuf

@teriyaki-89 Not sure if you managed to solve the issue, but {{{{raw}}}} is used to pass values that contain handlebars syntax like {{}}. I recommend you adding your external variable as a handlebar page variable instead. For example under you define the layout to use just add firstname: <%=objDoc.firstname%> and then reference it inside your file as {{firstname}}.

@DanielRuf I have tested the issue on my end and I can confirm that unless you use page variable trick, objDoc is converted to lowercase. It has something to do with <% sign. When you put a space between them - no issue.

nikitasol avatar Aug 10 '20 16:08 nikitasol