Mikrotik: WAN failover with e-mail notification

Scenario 2x WAN, both having a static public IP (called WAN_p1 and WAN_p3 in this example) 1x LAN You want to use WAN_p1 by default and the backup connection only if the main one fails. In both cases, the current IP should be updated to an external DDNS service, so...
  [email protected]