Expand my Community achievements bar.

Dive in, experiment, and see how our AI Assistant Content Accelerator can transform your workflows with personalized, efficient content solutions through our newly designed playground experience.
SOLVED

How to convert the below array code in AJO emailer

Avatar

Level 2

How to convert the below ACC/JavaScript array code in the AJO?

 

var secFour = [
{language:"englishVer", linetext:"Got Questions?"},
{language:"spanishVer", linetext:"¿Tienes Dudas?"},
{language:"frenchVer", linktype:"oca", linetext:"Avez-vous des Questions?"},
{language:"englishCaVer", linetext:"Got Questions?"},
{language:"englishVer", linetext:"Chat with our agents to get quick help"},
{language:"spanishVer", linetext:"Chatea con nosotras para obtener ayuda rápida"},
{language:"frenchVer", linetext:"Discutez avec nous pour une aide rapide"},
{language:"englishCaVer", linetext:"Chat with our agents to get quick help"}
];

var footerChatText = secFour.filter (function (textitem) {
return textitem.language == langVar
});

 

<h3><% document.write(secFour[langVar]);%></h3>

1 Accepted Solution

Avatar

Correct answer by
Level 2

@NiteshSingh 
try this  :

{{
var secFour = [
{language:"englishVer", linetext:"Got Questions?"},
{language:"spanishVer", linetext:"¿Tienes Dudas?"},
{language:"frenchVer", linetext:"Avez-vous des Questions?"},
{language:"englishCaVer", linetext:"Got Questions?"},
{language:"englishVer", linetext:"Chat with our agents to get quick help"},
{language:"spanishVer", linetext:"Chatea con nosotras para obtener ayuda rápida"},
{language:"frenchVer", linetext:"Discutez avec nous pour une aide rapide"},
{language:"englishCaVer", linetext:"Chat with our agents to get quick help"}
];

var langVar = replace with language preference attribute

var footerChatText = secFour.filter(function(textitem) {
return textitem.language === langVar;
});

footerChatText.length > 0 ? footerChatText[0].linetext : ''
}}

View solution in original post

2 Replies

Avatar

Correct answer by
Level 2

@NiteshSingh 
try this  :

{{
var secFour = [
{language:"englishVer", linetext:"Got Questions?"},
{language:"spanishVer", linetext:"¿Tienes Dudas?"},
{language:"frenchVer", linetext:"Avez-vous des Questions?"},
{language:"englishCaVer", linetext:"Got Questions?"},
{language:"englishVer", linetext:"Chat with our agents to get quick help"},
{language:"spanishVer", linetext:"Chatea con nosotras para obtener ayuda rápida"},
{language:"frenchVer", linetext:"Discutez avec nous pour une aide rapide"},
{language:"englishCaVer", linetext:"Chat with our agents to get quick help"}
];

var langVar = replace with language preference attribute

var footerChatText = secFour.filter(function(textitem) {
return textitem.language === langVar;
});

footerChatText.length > 0 ? footerChatText[0].linetext : ''
}}

Avatar

Administrator

Hi @NiteshSingh,

Was the given solution by @AJODev helpful to resolve your query?

Thanks!



Sukrity Wadhwa