pb-event: move send code to a separate function