phpmailer_init ignored on REST calls

I found the “issue”.

I had another mailing provider (Postmark) installed as a plugin, which I brought in my local site by mistake. That prevailed over any other mailing configuration.

I deactivated the plugin and now my hook works fine.

error code: 523