The client wants to rely on this service so emails can go through and alert teams on time. The service must be available or alert people in case of failure.
Merge similar scripts or scripts acting on similar actions. Comments lines and function to understand code block. Create easily readable logs. Push failure warning to IT group. Use modern auth and token.