Gravar-mail: Characterization of energy response for photon-counting detectors using x-ray fluorescence