Hi,
i'm creating a multilingual contact form, adding the 'multi language' event in the onLoad.
The form is working perfect. However as this is a "Contact Us" form a mail to the admin, a confirmation mail to the user and thanks message should be included.
If we use the replacement string like in the form this is not working.
We switched to coding for the mail body:
So we got it working as far for the mail bodies.
However when we try this working way for the "show Thank Message" it doesn't work.
Any idea how we could resolve this?
Please advise.
i'm creating a multilingual contact form, adding the 'multi language' event in the onLoad.
The form is working perfect. However as this is a "Contact Us" form a mail to the admin, a confirmation mail to the user and thanks message should be included.
If we use the replacement string like in the form this is not working.
We switched to coding for the mail body:
<?php
$lang = JFactory::getLanguage()->getTag();
if(JFactory::getLanguage()->getTag() == 'en-GB'){
echo '
<p>Hello president,</p></br>
<p>you have received an information request from:</p>
<div>
name : {name}</br>
email : {email}</br>
subject : {subject}</br>
message : {message}</br>
</div>
<p>Please respond to this inquiry.</br><p>
<p>PS: This request has been generated by the "Contact Us" form on the TOP-Koekelare website.<p>';
};
if(JFactory::getLanguage()->getTag() == 'nl-NL'){
echo '
<p>Dag voorzitter,</p></br>
<p>u hebt een informatie aanvraag ontvangen van:</p>
<div>
naam : {name}</br>
email : {email}</br>
onderwerp : {subject}</br>
bericht : {message}</br>
</div>
<p>Wil je antwoorden op deze vraag.</br><p>
<p>PS: Deze informatie aanvraag is aangemaakt door het "Kontakteer ons" formlier op de TOP-Koekelare website.<p>';
};
if(JFactory::getLanguage()->getTag() == 'fr-FR'){
echo '
<p>Bonjour président,</p></br>
<p>vous avez reçu une demande d\'informations de:</p>
<div>
nom : {name}</br>
courriel : {email}</br>
object : {subject}</br>
message : {message}</br>
</div>
<p>Veuillez répondre à cette enquête.</br><p>
<p>PS: Cette requête a été générée par le formulaire « Nous contacter » sur le site de TOP-Koekelare.<p>';
};
?>
So we got it working as far for the mail bodies.
However when we try this working way for the "show Thank Message" it doesn't work.
Any idea how we could resolve this?
Please advise.
Hi rodiusd,
I suspect that is because the Thank You page action doesn't accept PHP. Please try putting the same code into a Custom Code action in place of the Thank You page action.
Bob
I suspect that is because the Thank You page action doesn't accept PHP. Please try putting the same code into a Custom Code action in place of the Thank You page action.
Bob
Hi Bob,
thanks, but i tryed this already and it didn't work.
However solved the problem in using your "event switcher". Placed code who checks on the used languages and return even_x depending on the language.
In the different events i placed then the "show thanks message" action with the corresponding text.
So this problem has been solved.
For the initial mail send to the side admin, well thinking about this,.. this should not language depending.
So my contact form is limitid to one edition for the three lanuages we support.
Thanks again for the [GH].. action.
thanks, but i tryed this already and it didn't work.
However solved the problem in using your "event switcher". Placed code who checks on the used languages and return even_x depending on the language.
In the different events i placed then the "show thanks message" action with the corresponding text.
So this problem has been solved.
For the initial mail send to the side admin, well thinking about this,.. this should not language depending.
So my contact form is limitid to one edition for the three lanuages we support.
Thanks again for the [GH].. action.
This topic is locked and no more replies can be posted.