Creating and sending two kinds of notification messages
You could split the two decisions, for instance:

# Outside your method 
EVENT_TO_USERKIND = { pending: 'shopper', handed_over: :'deliverer' }

# Now inside your method 
user_kind = EVENT_TO_UID_METHOD[parse_events]
if user_kind &amp;&amp; send_push_notification(order.send("#{user_kind}_id"), order, parse_events)
  order.send("#{user_kind}_notified_at=", now)
end


It's more compact and concise, but the usage of send might be considered ugly, and it depends on naming convention (do not dare to rename deliverer_notified_at to delivery_guy_notified_at!), so you have to choose whether or not you like it.