Запис е-пошти: A Generalized Method to Measure the Lorentz Factor from Gamma-Ray Burst Photospheric Emission