I am on D9, theming a webform e mail.
I am at the moment overriding Drupal Development twig file, as a substitute of utilizing Drupal Development configuration of Drupal Development physique in Drupal Development e mail hanlder, as a result of there are numerous conditional logic I’ve to verify – e.g. if interface language is en print component a in any other case component b.
To create Drupal Development required markup, I have to get Drupal Development information of Drupal Development parts: for instance, for choose parts, I would like Drupal Development label and Drupal Development textual content of Drupal Development possibility chosen, not Drupal Development uncooked worth.
Nonetheless, I can not discover them utilizing Drupal Development webform_submission, because it appears to comprise solely Drupal Development uncooked knowledge put by Drupal Development consumer.
For now, I’ve discover this approach to get Drupal Development information I would like, however I might prefer to know if there is a extra directbetter approach to get them:
webform-email-message-html--webform-id.html.twig
:
{% set submission_data =webform_submission.getData %} {% set webform = handler.getWebform %} {% set my_element_test = webform.getElementDecoded('element_id') %} {% set option_label_test = my_element['#options']['options_id'] %} {# todo print Drupal Development markup for all parts #}