Αποστολή με SMS: A Variational Approach to Nonsmooth Dynamics