Extract email addresses from composite field type using Computed Twig I am using a custom composite field type to gather multiple pieces of data from a user. This custom composite field type contains a field which gathers the email addresses entered.
What I am trying to do is use a Computed Twig field to extract the email addresses entered within the custom composite field type and use an email handler to send a confirmation email to all those email addresses, however, I am having real trouble trying to reference a field inside a composite field type. I have used multiple pieces of twig code, but all I seem to be able to reference is the values from all the fields in the custom composite and not a specific field.
I am really new to twig, so do not understand the full capabilities yet, but does anyone know how to reference a field value inside a composite field type, using twig?
I'll provide 2 links as an answer, but it has really been answered by others.


Write custom webform handler:


How to create a custom Webform handler to submit to a SOAP API


Use hook_form_alter() to add a custom submit handler.


Add a custom submission handler to a form

Drupal 8 version of hook_form_alter(): https://api.drupal.org/api/drupal/core%21lib%21Drupal%21Core%21Form%21form.api.php/function/hook_form_alter/8.8.x