Check if args.notification_type is defined before using it. Closes #35624.