I am getting 412 Gmail_API: Request had insufficient authentication scopes while trying to configure service in Email JS. Also, receiving the same error while sending email using React.js library.
Below is the screenshot of the error.
I am getting 412 Gmail_API: Request had insufficient authentication scopes while trying to configure service in Email JS. Also, receiving the same error while sending email using React.js library.
Below is the screenshot of the error.
I had the same and submitted the question, their answer was: "To solve this problem, you need to go to EmailJS dashboard -> Services, click on the Gmail service in your list, and reconnect your account. Please click on the checkbox "Send email on your behalf" to allow us to send the emails through your Gmail account. The new Gmail access popup leaves all permissions disabled by default."
Had to disconnect and re-connect my email address:
Go to emailJS dashboard and select "Email Services" on the top left
Clicked on the service that is getting the error in your list of email services and select "Disconnect" next to your connected email address
Then select "Connect Account" to reconnect your email address (I'm using gmail) and finish by clicking "Update Service"
That solved the issue for me, best of luck!
Piggy backing off of what abo mentioned, the error may also arise because it was your first operation via EmailJs.
I also got the 412 status code. I logged error.text from the emailJS.sendForm() call and got this:
"Gmail_API: Invalid grant. Please reconnect your Gmail account"
Ksenia's answer was the fix for me as well. If you're curious as to why it's happening see this post.
In my case it was due to my account being inactive for 6 months.
Just repeat the process, when you get the notification that emailjs has found n-number services with your email already click done then proceed and click continue. this worked for me.