Automatically add members to Buddypress groups after subscribing

I’m using the Membership plugin and I’d like to automatically add new subscribers to a specific Buddypress group – is this possible?

Is the way to do this via Subscription Pings?

If so could you point me to a sample snippet that I could use?

i.e. when someone subscribes to XYZ Subscription they would be automatically added to a corresponding XYZ Buddypress group