Send email from Listview to selected Documents and link email to all receivers

I figured out to send Emails to all selected custom Documents from ListView. But the sent email is only linked to first receiver. Is it possible to link one Email to multible documents?

Yes, that for, you have to develop the listview js and send mail that you selected row.

This Client Script sends Email to all selected Documents in Listview. But the email is only linked to the first recipient. How can I link it to all recipients?

Client Script:

frappe.listview_settings[‘Kontakte’] = {
onload: function(listview) {
listview.page.add_inner_button(__(‘Email schreiben’), function() {
const selected = listview.get_checked_items();

        if (selected.length === 0) {
            frappe.msgprint(__('Please select at least one contact.'));
            return;
        }

        // Email-Adressen der ausgewählten Kontakte sammeln
        let emailAddresses = [];
        selected.forEach(contact => {
            if (contact.email) { 
                emailAddresses.push(contact.email);
            }
        });

        if (emailAddresses.length === 0) {
            frappe.msgprint(__('No email address found for the selected contacts.'));
            return;
        }
        const recipient = emailAddresses[0];
        const bcc = emailAddresses.slice(1).join(', ');

        new frappe.views.CommunicationComposer({
            doc: {
                doctype: "Kontakte", 
                name: selected[0].name
            },
            recipients: recipient, 
            bcc: bcc,
            subject: __('Subject')
        });
    });
}
};