- register/unregister (add and remove address to/from list in database)
- send a welcome mail on registering
- auto-send each day
I made some notes about how I would achieve each element ready for when I woke up before finally dropping off.
Adding and removing your address is fine and the welcome mails go out correctly while redirecting you to a separate welcome page. Removing your address provides a prompt rather than redirecting to a separate page.
Each address in the list is added as a BCC to preserve subscribers privacy. Using
wp_mail they are each added as a separate header item so I have to loop through them individually. As an additional privacy measure I might look at encrypting the addresses in the database but that's for another day.
It's a bit rough and ready, and could probably be made a little (okay, a lot) prettier, but it seems to do the trick.
As with the custom RSS feeds, it's not something I anticipate anyone actually signing up for. I just thought it was worth a shot at creating as much for the intellectual exercise than the functionality.
Maybe, in future, I could hook into it to send additional mails or a newsletter and have it all self-hosted rather than relying on a third party service like Mail Chimp.