[ticket/11489] Code optimizations for notifications

Using new variables instead of duplicating code in notifications template vars

PHPBB3-11489