We present ab initio calculations of the temperature-dependent exchange of energy between a classical charged point-particle and the phonons of a crystalline material. The phonons, which are computed using density functional perturbation theory (DFPT) methods, interact with the moving particle via the Coulomb interaction between the density induced in the material by phonon excitation and the charge of the classical particle. Energy relaxation rates are computed using timedependent perturbation theory. The method, which is applicable wherever DFPT is, is illustrated with results for CsI, an important scintillator whose performance is affected by electron thermalization. We discuss the influence of the form assumed for quasiparticle dispersion on theoretical estimates of electron cooling rates.