A woman who carried out a “disgraceful” campaign of harassment against her boyfriend’s ex-partner has narrowly avoided prison.