In a system where electricity is increasingly generated by renewables, using boilers to produce thermal energy is no longer the most efficient option.
If we take into account that a high average performance (95%) natural gas boiler (the fossil fuel with the lowest emissions) produces 215 gCO2/kWht worth of emissions, the electric option would be preferable, as long as the electrical system's emissions coefficient is lower.
Now in the current situation, the performance of all heat pumps is enormously advantageous compared to a gas boiler. This advantage is enhanced in an energy system whose emissions coefficient tends to zero thanks to the massive incorporation of renewable sources.
The electric option enables users to offer demand-side management services by regulating the automatic on/off in their climate control systems (acting on thermostats), without affecting their comfort, contributing to efficiency and to a better regulation of the system.