*8969* Fixed notifications emails 

I like ternary operators in cases like this:
$userId = $user?$user->getId():null;