auto. Works perfectly. In the second email I'd like to send a confirmation to the user who submits the form. Email consists of pre text and form with filled data. I refer in the second email to the form data from the first email through php code form[Form][extras][actions_config][2][template]); ?>It works fine beside the translation strings. In the second email they are not translated. User gets keys not values. Strangely enough chronoforms debugger shows correctly translated data in email body!Is there another way to refer the original data from the form with translated strings? I can copy the form code to the second email template and add pre-text but form on the site changes often and I'd like to avoid this repeated and error prone task. I'd rather have pre-text and reference with php variable set.Thanks in advance for any help or clues,Lindus"> Translated strings in confirmation email - Forums

Forums

Translated strings in confirmation email

lindus 24 Aug, 2014
Hi,

I work with J 3.31 and CF 5.0 multilingual. Language strings are created in "Locales".
I have created two Emails action on "On submit" event. The first Email is a simple confirmation to administrator with form data based on settings - Template Generation > auto. Works perfectly. In the second email I'd like to send a confirmation to the user who submits the form. Email consists of pre text and form with filled data. I refer in the second email to the form data from the first email through php code
<?PHP echo ($form->form[Form][extras][actions_config][2][template]); ?>

It works fine beside the translation strings. In the second email they are not translated. User gets keys not values. Strangely enough chronoforms debugger shows correctly translated data in email body!

Is there another way to refer the original data from the form with translated strings? I can copy the form code to the second email template and add pre-text but form on the site changes often and I'd like to avoid this repeated and error prone task. I'd rather have pre-text and reference with php variable set.

Thanks in advance for any help or clues,
Lindus
GreyHead 25 Aug, 2014
Hi Lindus,

I just tested this and got the same result as you did (though I used a simple included file for the template).

I think it happens because the string replacement is done before the PHP evaluation of the code. So if you include the template there is nothing there to translate. Though quite why the Debug version is translated correctly I'm not clear - perhaps that is processed again later.

I don't have a solution for you at the moment. I'll continue to think about it and see if I can work out a way around this.

Bob
lindus 25 Aug, 2014
Thank You for your effort to sort this out. If you come up with any idea I'll be very pleased.

Regards,
Lindus
GreyHead 21 Oct, 2014
Hi Lindus,

Sorry for the late reply - I've just re-found this post.

I've never done it the way that you are using. I would use a Custom Code action to create the segments of text / HTML for the template, add them to the $form->data[''] array and then include the required segments into the Email templates.

Bob
This topic is locked and no more replies can be posted.