Load Media File in Webform Mail Handler
$media_id = \Drupal::request()-&gt;get('media'); // get value of media query param

$media = Drupal\media\Entity\Media::load($media_id); // load the Media entity

$media_name = $media-&gt;getName(); // get the media item name

$media_field = $media-&gt;get('field_media_image')-&gt;first()-&gt;getValue(); // get media field

$file_id = $media_field['target_id']; // get the File ID

$file =  Drupal\file\Entity\File::load($file_id); // load File entity

$image_url = $file-&gt;url(); // get image url




You could take this shortcut instead of writing the last 4 lines.

$image_url = $media-&gt;get('field_media_image')-&gt;entity-&gt;url();