Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

egarcia's avatar
Level 12

Spark v4: Error sending team invitations

Just upgraded to version 4.0.7 and I'm getting an 500 server error at the moment of send an invitation to a new member team.

I previously setup my mail driver to mailgun but appears to be a problem with ajax post on this route: https://{domain}.dev/settings/teams/1/invitations

This error appears on javascript console:

Imgur

UPDATE: Invitation records on database are created successfully, email not sent.

0 likes
6 replies
egarcia's avatar
Level 12

@Cronix Yes, everything compiled ok, even previously cleared my node_modules directory to avoid any conflict with new versions, but still showing up that error, invitations are created on database, email was not sent

Cronix's avatar

I'm running 4.0.7 and it sends the invite email and signs the user up when they click the link in the email. I'm using mailtrap.io for the email. I'm not really sure where to point you but just wanted to say it's working properly here. I know that's no help lol.

1 like
egarcia's avatar
Level 12

I'll try to setup smtp or mail trap to test my email configuration

briang's avatar

The error you posted in the screenshot isn't all that helpful. What is the actual response body of that post request? (you should be able to get it by clicking the URL at the top of the error). It may very well contain a more human readable Laravel exception/error.

I can confirm that the invitation process is working correctly for me in Spark v4.

1 like
egarcia's avatar
egarcia
OP
Best Answer
Level 12

It was a missconfiguration with mailgun's secret key, my fault!

Laravel or Spark must handle ClientException in RequestException and display a flash message?

Because invitation it was created, but incomplete due a missing email.

@briang sorry for a late response, your comment helped me to remember uncheck my filters in debug tool

Please or to participate in this conversation.