build notification function