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
Comment #2
jrockowitz commentedYou have to create a preprocessing function to expose additional data.