This circuit uses a P-channel mosfet and an NPN to turn on power to the D1 Mini when the mailbox door is opened. When the processor has finished sending the notification, it turns its own power off. So there is zero battery power consumed between door openings.