Anil
Anil

Reputation: 111

Why am I getting error while adding service in EmailJS?

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.

Image displaying error while adding service

Upvotes: 11

Views: 29378

Answers (6)

Artur
Artur

Reputation: 857

Just disconnect and connect it again and it's worked fine

enter image description here

Upvotes: 0

masete
masete

Reputation: 39

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.

Upvotes: 0

Piggy backing off of what abo mentioned, the error may also arise because it was your first operation via EmailJs.

Upvotes: 1

James Easter
James Easter

Reputation: 319

Had to disconnect and re-connect my email address:

  1. Go to emailJS dashboard and select "Email Services" on the top left

  2. Clicked on the service that is getting the error in your list of email services and select "Disconnect" next to your connected email address

  3. 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!

Upvotes: 11

abo
abo

Reputation: 86

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.

Upvotes: 0

Ksenia
Ksenia

Reputation: 251

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."

Upvotes: 25

Related Questions