user
Create a script that sends out automatic email notifications to customers.


assistant
The script should contain the following sections: 

1. A check to see if customers have opted-in to the service.
2. A loop to iterate through each customer’s email address. 
3. A method to construct and format the email. 
4. A method to send out the automated email notification. 
5. A section for any error handling.