You're close, and your first formula works nicely for the ungrouped scenario. The second one just needs a better way to dynamically group entries by the link in 'Tickets'!B2:B, and then create a proper email body per group.
'Tickets'!B2:B