Now we will go all the way back to Plank who proposed that the emission of radiation be in quanta with to solve the problem of Black Body Radiation. So far, in our treatment of atoms, we have not included the possibility to emit or absorb real photonsnor have we worried about the fact that Electric and Magnetic fields are made up of virtual photons. This is really the realm of Quantum Electrodynamics, but we do have the tools to understand what happens as we quantize the EM field.
We now have the solution of the Harmonic Oscillator problem using operator methods. Notice that the emission of a quantum of radiation with energy of is like the raising of a Harmonic Oscillator state. Similarly the absorption of a quantum of radiation is like the lowering of a HO state. Plank was already integrating over an infinite number of photon (like HO) states, the same integral we would do if we had an infinite number of Harmonic Oscillator states. Plank was also correctly counting this infinite number of states to get the correct Black Body formula. He did it by considering a cavity with some volume, setting the boundary conditions, then letting the volume go to infinity.
This material is covered in Gasiorowicz Chapter 22, in Cohen-Tannoudji et al. Chapter XIII,and briefly in Griffiths Chapter 9.