This is the technical support forum for WPML - the multilingual WordPress plugin.

Everyone can read, but only WPML clients can post here. WPML team is replying on the forum 6 days per week, 22 hours per day.

Tagged: 

This topic contains 8 replies, has 2 voices.

Last updated by Carlos Rojas 12 months ago.

Assigned support staff: Carlos Rojas.

Author Posts
October 15, 2018 at 12:46 pm #2817476

José

Hello,

I have a contact form 7 and need to subscribe users that contact us throught that contact form to a mailchimp list.

I manage to do that adding a shortcode from mailchimp for wordpress plugin that creates a checkbox on the form asking users if they allow to be subscibed.

However, the site is multilingual, therefore I need to know the language the users have sent the email from, ie, language must be sent to mailchimp with the email.

Example:

- User uses contact form in spanish contact page - it must send spanish to the mailchimp list
- User uses contact form in english ocntact page - its must send english language

The goal is being able to email users in their languages afterwards in our email campaigns.

I've contacted mailchimp for wp and they told me this:

"For sending language via CF7 form, you will first need to ask the developers of the translation plugin how to get the value for the language in a shortcode and then check hidden link to learn more about sending additional fields from CF7 to MailChimp."

Thank you

October 16, 2018 at 3:00 pm #2821468

José

Hello,

Anyone?

Complementary info from mailchimp for wordpress plugin support team:

"You need to add this field to your CF7 form:
<input type="hidden" name="mc4wp-MMERGE4" value="" />

For the value field, you need to ask the translation plugin developers about the shortcode to send site language."

I have Mailchimp for WordPress WPML Integration addon installed and activated.

Waiting for your feedback.

Thank you

October 17, 2018 at 2:53 am #2823008

Carlos Rojas
Supporter

Languages: English (English ) Spanish (Español )

Timezone: America/Montevideo (GMT-03:00)

Hello,
Thank you for contacting WPML support.

I recommend you to visit this links where you will find some functionalities that might help you solve this issue:
- https://wpml.org/documentation/support/wpml-coding-api/
- https://wpml.org/wpml-hook/wpml_add_language_form_field/
- https://wpml.org/documentation/support/wpml-coding-api/wpml-hooks-reference/

You can create a shortcode that echoes a hidden input with the value of the current language.

Kind regards,
Carlos

October 17, 2018 at 8:12 am #2823719

José

Hello,

I'm sorry but that was to technical and so many links got me confused. Please explain what I should add as "value".

Tks

October 17, 2018 at 7:10 pm #2825726

Carlos Rojas
Supporter

Languages: English (English ) Spanish (Español )

Timezone: America/Montevideo (GMT-03:00)

Hi,

The value to use is the one in the constant ICL_LANGUAGE_CODE, this constant have the code for the current language.

Best regards,
Carlos

October 18, 2018 at 1:52 pm #2828189

José

Just to make sure:

You mean "es" for spain or "fr" to france, for example?

Also, my list mailchimp list has a column "Country" and my form has a dropdown country field - how can I send the country that is selected to the mailchimp country column too?

Thanks

October 18, 2018 at 4:42 pm #2828857

Carlos Rojas
Supporter

Languages: English (English ) Spanish (Español )

Timezone: America/Montevideo (GMT-03:00)

Hi,

Yes, the the constant ICL_LANGUAGE_CODE carries the language code like 'es' for Spanish and 'fr' for French.

Regarding the question of the Country list, I recommend you to contact the support service of Contact Form 7 as this falls outside of WPML's functionalities. CF7's support service will be able to help you solve this issue.

Please let me know if you need further assistance with WPML and I will be more than happy to help.
Best regards,
Carlos

October 22, 2018 at 2:11 pm #2838399

José

Hello,

Can I make the [mc4wp_checkbox] mandatory? (I only see a pre selected option )

updated: well, maybe this is a question for the plugin guys..

Thank you

October 22, 2018 at 5:28 pm #2839219

Carlos Rojas
Supporter

Languages: English (English ) Spanish (Español )

Timezone: America/Montevideo (GMT-03:00)

Hi,

Yes, I recommend you to contact CF7 support service and ask them about this question.

Best regards,
Carlos