Magento: How to assign a group to user based on domain name email registration

First of all, you create customer group. let say you already create customer group with group_id 7. you can create customer group in backend Admin => Customer => Customer Group. my group_id is 7 & my group name Student.

You can do this by Magento event observer and also register Observer in config.xml

#1 STEP

Register Module in app/etc/modules/Rifki_MembershipGroup.xml

#2 STEP

Create module folder in app/code/local/Rifki/MembershipGroup/

then create config.xml in app/code/local/Rifki/MembershipGroup/etc/config.xml

#3 STEP

create event observer in app/code/local/Rifki/MembershipGroup/Model/Observer.php

 

See more about Magento event observer  https://magento2.atlassian.net/wiki/display/m1wiki/Using+the+Event-Observer+Method+in+Magento+1.x

Cheers!