In my limited research so far, I believe this will require the following features;
IR capability for night time shots
AFAIK no CHDK supported cameras have IR capability from the factory. To shoot IR, you need to physically remove the IR cut filter, which requires non-trivial hardware modification. You should be able to find some examples in the forum or google. There have also been some vendors who offered this a service for astrophotography.
For CHDK, the only alternative would be a visible light, perhaps also motion triggered.
Also note that if you remove the IR filter, colors will be wildly wrong.
CHDK supports motion detection on pretty much every camera. Some scripting would most likely be required to integrate it with proposed system.
Wi-Fi connectivity to local PC or NVR with email push
CHDK does not currently support wifi connectivity in any way. The native wifi support in Canon firmware is likely not sufficient to implement this. You can control the camera with raspberry pi or similar over USB (using the PTP extension https://chdk.fandom.com/wiki/PTP_Extension
) and then use the pi for wireless connectivity. The webcams on http://escursionisticivatesi.it/webcam/
use this approach.
wifi SD cards might be another option, like eyefi or some hackable cards like https://chdk.setepontos.com/index.php?topic=11262.0
Doing what you described with CHDK will be a significant project. You might be better off with an off the shelf security system, something built on raspberry pi without CHDK, or perhaps a wildlife/trail camera.
If you want to go DIY, the raspberry pi approach seems attractive, AFAIK the cameras are available without IR cut, and network support is very good, with either wifi or cellular.
Unfortunately, most Wireless LTE carriers force you to purchase a very expensive static IP address to log into an NVR.
It seems like this should be solvable by using a tunnel or VPN of some sort.
You might be interested in this project: https://chdk.setepontos.com/index.php?topic=12942.0
(I don't know what the current status is)