Forum

Thread tagged as: Problem, MailChimp

[Mailchimp] Use of perch:if within perch:input

Hi there,

I've integrated my site with Mailchimp App. Everything works fine: user can subscribe to the newsletter and I get the list of subscribers in the mailchimp interface.

I've localised the input text as well as the submit button. For this, I use <perch:if> to display the content according to the current language.

subscribe.html

<perch:input id="email" required="true" type="email" placeholder="<perch:if id="current_language" match="eq" value="fr">Adresse email<perch:else />Email address</perch:if>" mailer="email" class="footer-field__input" />

<perch:input type="submit" value="<perch:if id="current_language" match="eq" value="fr">S'inscrire<perch:else />Subscribe</perch:if>" id="btnsubmit" class="button primary single" />

It works fine – the content gets translated.

However, this seems to create a conflict with Mailchimp: despite getting the success message upon submitting the from, the new entry is not populated on Mailchimp interface.

Is it actually valid to use <perch:if> within <perch:input>? If yes, is this be a problem with Mailchimp App?

I've removed the translations for now, it works fine without these. Just thought of reporting this.

Cheers,

Robin Pick

Robin Pick 5 points

  • 7 years ago
Drew McLellan

Drew McLellan 2638 points
Perch Support

Could you do this?

<perch:if id="current_language" match="eq" value="fr">
     <perch:input id="email" required="true" type="email" placeholder="Adresse email" mailer="email" class="footer-field__input" />
<perch:else />
    <perch:input id="email" required="true" type="email" placeholder="Email address" mailer="email" class="footer-field__input" />
</perch:if>

Haha, why I didn't think about this? It worked, thanks.