refactored code at notification email for less posts