I needed recipient $uid in hook_mail_alter, I'm attaching a patch for this in case if others will find this useful. Also $languages array wasn't initialised in this scope.
Closed: outdated
1.0
Code