Custom email text after Paypal payment

Hi, I have created a custom PayPal button by adding the code into an HTML iframe. So, my question is is there a way I can add some codes in that HTML iframe(see below) so that after my customers make a payment, they will automatically receive a custom email text from me (not from PayPal). I need that custom email to include their booking details such as ‘name’, ‘email’, ‘phone’, and any other relevant important information such as ‘booking date and time’ and ‘amount paid’.

Below is the code:

<script type="text/javascript"> 

	let AMOUNT = 0; 
	window.onmessage = (event) => { 
    	if (event.data > 0) { 
		AMOUNT = event.data; 
    	} 
  	} 

    paypal.Button.render({ 

        style: { 

layout: ‘horizontal’,
fundingicons: ‘true’,
size: ‘large’,
color: ‘gold’,
shape: ‘rect’,
label: ‘pay’
},

        env: 'sandbox', // sandbox | production 

        // PayPal Client IDs - replace with your own 
        // Create a PayPal app: https://developer.paypal.com/developer/applications/create 
        client: { 
            sandbox:    'xxxxx', 
            production: 'xxxxx' //Note that I haven't include my IDs yet. 
        }, 

        // Show the buyer a 'Pay Now' button in the checkout flow 
        commit: true, 

        // payment() is called when the button is clicked 
        payment: function(data, actions) { 

            // Make a call to the REST api to create the payment 
            return actions.payment.create({ 
                payment: { 
                    transactions: [ 
                        { 
                            amount: { total: `${AMOUNT}`, currency: 'MYR' } 
                        } 
                    ] 
                } 
            }); 
        }, 

        // onAuthorize() is called when the buyer approves the payment 
        onAuthorize: function(data, actions) { 

            // Make a call to the REST api to execute the payment 
            return actions.payment.execute().then(function() { 
                window.alert('Payment Complete!'); 
            }); 
        } 

    }, '#paypal-button-container'); 

</script> 

As written in your html code: ‘// Make a call to the REST api…’, you’re better off using Paypal’s own API and using it via code.
https://support.wix.com/en/article/corvid-accessing-third-party-services-with-the-fetch-api
https://developer.paypal.com/docs/api/overview/?mark=REST%20API

Otherwise, you can pass data to and from iframes and page by using code too:
https://support.wix.com/en/article/corvid-working-with-the-html-element
https://www.wix.com/corvid/reference/$w.HtmlComponent.html