How To Send a Failed Payment Notification

Use the code snippet below to send an email to a subscriber whenever a payment fails.