In Class WebformSubmission The $data variable is protected hence you cannot access the webform_submission within a twig template.

class WebformSubmission extends ContentEntityBase implements WebformSubmissionInterface {
protected $data = [];
}

webform\templates\webform-email-message-html.html.twig

Twig templates override files for emails notifications for hardcoding email templates as files.

{#
/**
* @file
* Default theme implementation for webform email wrapper template as HTML.
*
* Available variables:
* - message: The email message which contains to, from, subject, message, etc…
* - webform_submission: The webform submission.
* - handler: The webform handler.
*
* @ingroup themeable
*/
#}
{{ message.body }}

Am i missing something?

Comments

nightowl_oo created an issue. See original summary.

jrockowitz’s picture

Status: Active » Closed (outdated)
The Webform module's issue queue is for bugs, feature requests, and planning. Please post general support questions to Drupal Answers. You can also ask questions or help answer questions on the #webform channel on Drupal Slack.

You have to create a preprocessing function to expose additional data.