The goal for this project is to get an email when the mail is delivered.
By reusing my garage door left open notifier circuit board, this gets a lot easier. Originally when I made my garage door circuit, the wifi chip would periodically wake up and check the state of the tilt switch, about every minute. That worked okay for the garage door, since I figured I wouldn't be opening and closing it very fast, but that wouldn't work for this project, the state of the tilt switch changes too quickly. But with my most recent version of garage door state detection, I use a smaller microcontroller that pulls ~6ua while running to check the state of the tilt switch. When the state changes, it wakes up the wifi chip, a Nodemcu, and the nodemcu does all the wifi work. That is perfect for this type of project.
This shows the basic diagram, if you want to see all the details go check out the Garage door left open detector project.
It seems like the only hard part of this project is figuring out how to mount the tilt switch. I ended up sticking it vertically on the very bottom edge of the mailbox door with some hot glue.
And in testing it seems to work like I expect, I have the pins pointed down so when the door is closed, the switch reads closed.
Then when the door is open, the switch reads open.
I hooked up rest of the circuit, and it seems to be working. Next up is testing it out in the real world.