We develop a framework that provides a few-mode master equation description of the interaction between a single quantum emitter and an arbitrary electromagnetic environment. The field quantization requires only the fitting of the spectral density, obtained through classical electromagnetic simulations, to a model system involving a small number of lossy and interacting modes. We illustrate the power and validity of our approach by describing the population and electric field spatial dynamics in the spontaneous decay of an emitter placed in a complex hybrid plasmonic-photonic structure.