Beaconing application - begin code with system off, press button to wake up


I am working on a beaconing application and I was wondering if it is possible to run the code beginning with system off mode and wake up the board with a button press? Once I wake up the board, I would like it to immediately begin advertising. Am I able to initialize all my functions before entering system off mode?

Thanks for the help