RH Factor Question

My question is regarding the rh factor. If you are rh negative and experience a missed or early miscarriage. Would you still need to have a rhogam shot? I was told ot could effect future pregnancies as well as if you are carrying a fetus that is rh positive.