My form has 2 language options (french* and english*). Upon selecting french, the submitted webform data gets formated and displayed correctly in the received email. The english one doesn't. (displays only the raw HTML data in the received email)

Note: the html template is the same for both french and english

*French being my translated language
*English being the original language

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

vasmir created an issue. See original summary.

vasmir’s picture

Version: 8.x-5.x-dev » 8.x-5.0-beta9
Issue summary: View changes
jrockowitz’s picture

@vasmir Welcome to the Drupal community.

It is possible that your mail server/client is having a problem with the emails.

Can you turn on email debugging for each handler and see what is displayed onscreen?

vasmir’s picture

@jrockowitz
Thanks for the welcome.

I am using webform with the smtp authentification module as my core mail function doesn't work/doesn't send mails.

I turned on debugging something interesting happens..
The html template gets formated correctly (during french output), but upon english submit, the html data comes in raw without any formatting.

jrockowitz’s picture

That helps a lot. I will try to find to duplicate the issue locally.

One very simple question... Is HTML enabled for both emails?

vasmir’s picture

Yes, I activated HTML for both emails. HTML is also enabled in my smtp settings.
Another interesting and weird observation I made: Like I stated, without smpt module, webform won't send mails. On the other hand, when smpt is activated BUT Html is turned off in the smtp settings, suddenly the html gets formatted in webform but not perfectly.

let me help you with duplicating, here my settings:

-activate HTML for webform handler and in the smtp module
-paste your html template in the translate tab in webform for french
-paste your html template in the original language mail handler (english)
-created a form with language switcher (where users can pick between french and english)

jrockowitz’s picture

It is very likely that the Webform configuration translation might be losing the send as HTML setting.

jrockowitz’s picture

I can't duplicate this issue. Hopefully someone who is using the SMTP module can help us figure out the problem.

jrockowitz’s picture

jrockowitz’s picture

Issue summary: View changes
Status: Active » Postponed (maintainer needs more info)
FileSize
562.17 KB

So, I finally got SMTP working and was able to send HTML emails the source and translated languages.

It is worth noting that each translation has it's own template.

vasmir’s picture

As I understood, in the "email body" field, the value "default" refers to the value selected in the mail handler, but in the handler, you can't change the default text. I tried with the "custom" option but it doesn't do anything. How did you manage to add your HTML template in the "default" text?

jrockowitz’s picture

The default template can be edited and translated via /admin/structure/webform/settings

The custom template should be editable. Please look at the browser's console to see if any errors are being logged.

jrockowitz’s picture

Status: Postponed (maintainer needs more info) » Closed (cannot reproduce)