The optical theorem links the imaginary part of the forward scattering amplitude to the total decay width of a particle: $\mathrm{Im}\,M_{i\to i} = m\Gamma_{tot}$. Here $\Gamma_{tot} = \frac{1}{2m} \sum_x |M_{i\to x}|^2$. My QFT lecturer told us that the Breit-Wigner propagator $\frac{i}{p^2-m^2+im\Gamma_{tot}}$ follows from that. How?
I tried to use the LSZ formula to replace the forward amplitude to the propagator. However I don't even know if the LSZ formula is applicable here (due to the complex mass). If one can use it I find something like (for a scalar particle) $iM_{i\to i} \sim (p^2 - m^2)^2 \cdot \frac{i}{p^2-m^2+i\varepsilon}$ which should simply vanish for on-shell particles, whether or not $m$ has an imaginary part.
So how does the Breit-Wigner propagator follows from the optical theorem? In particular why is the $\Gamma$ in the Breit-Wigner propagator the same as in the optical theorem?