There’s a possibility I may have confused myself. Let me have an explore and see if there’s a way to achieve what you want using the existing forum features.
Edit:
I think this is possible using the Bulk Invite option. If you have a csv file of email addresses, with a second column for the group(s) you wish to add them to, then running that through the Bulk Invite tool will email an invite to anyone who doesn’t have an account, and add existing members to the group(s) you entered in the second column. Though the missing bit would be that this doesn’t generate a notification to say that you’ve been added to the group.