Invert logic of state changes to avoid sending emails when a crash occured
If link to RT or PDF generation fails, state change is not recorded, but emails are still sent. Sending emails as the last action in all cases avoids sending unecessary emails to users in case of an issue with RT of PDF bundler.