Auto add user to a groups in depends by user email domain

Hi guys, how i can add user to a group by parsing their email?
I have realm with one or more identity providers.
Can You help me with solution?
I want auto add user to a specific group after their login.

like this
user.name@domain.one -->> group_one
user.name@domain.too -->> group_too