How to create and save an alert?