Eliashberg theory for spin fluctuation mediated superconductivity: Application to bulk and monolayer FeSe