Error: Maximum function nesting level of '512' reached when injecting custom service to webform (6.x) handler
The problem is that you're instanciating the Ecomail object into your Ecomail constructor $this-&gt;ecomail = new \Ecomail($this-&gt;config-&gt;get('api_key')); which is kind of a fork bomb.
Your Ecomail is creating an Ecomail itself creating another Ecomail, etc.
That's an infinite loop