This is the logic as on invites.html, right?  Can we factor this to not repeat it somehow, maybe by putting it in a common App or something?