Hello and welcome to the forum!
I believe you can achieve this without writing any code. You can instead use InfoPath's built-in functionalities. Below are some suggestions:
1. Add Email Submit data connections in your form (Tools Menu > Data Connections). You will have 2 different email submit connections, 1 for the first submit and 1 for the second (approve). In these, you will specify the recipient email address accordingly.
2. Add a rule to your first Submit button that submits using the first email data connection.
3. Do the same for your second Submit (Approve) button > second email data connection.
You can add conditional formatting to your buttons such that if the user (person filling out the form) is not the approver, then disable or hide the Approve button, and vice-versa; OR, you can use just one button for both submits, and configure your rules with conditional formatting.
i.e.
First Rule: If "User" is not equal to "Approver", then submit using the first email data connection.
Second Rule: If "User is equal to "Approver", then submit using the second email data connection.
I hope that makes sense. Otherwise, please let me know and I'd be glad to assist you further.
Cheers!