The woman faces a six-month curfew, during which her movements will be curtailed. (Representational)

A British Sikh woman was handed down a two-year suspended jail term by a UK court for launching a campaign of racist abuse and harassment against her Hindu ex-boyfriend and his family over a period of five years, including posting beef through their door as an attack on their faith.

Amandeep Mudhar had pleaded guilty to racially aggravated harassment and was handed down a two-year sentence at Swindon Crown Court in south-west England on Tuesday.

"Most people from religious backgrounds seek to find a common ground on what they share, be it a faith in god or human nature. Not from you: your behaviour was unrelenting, provocative and extremely frightening," said Judge Robert Pawson during the sentencing hearing.

The court was told of Amandeep Mudhar orchestrating a series of attacks on the unnamed family of her former boyfriend, including abusive and threatening phone calls and attacks on social media.

The court was told that the 26-year-old had a brief relationship with the man, which was "never fully intimate", over a few weeks in 2012.

But after he ended the affair citing cultural differences, Amandeep Mudhar and her family launched into the attacks which included threats of rape against his sisters and mother and also to blow up their home and cars, the local daily 'Swindon Advertiser' reported.

Prosecutor Sue Cavender told the court that after 2015, she was made subject to a harassment warning by the police and a civil injunction brought by the family, which prevented her from contacting them.

However, she breached that with a social media message two minutes before it expired, saying to one of his two sisters "now watch what happens", the report said.

Amandeep Mudhar then enlisted the help of a friend, 30-year-old Sandeep Dogra, to send numerous "offensive" Facebook and Instagram posts directed at the family. As well as threats to kill them and rape them, one of the comments branded them "fat, like your elephant god".

The duo also went to the temple the family frequented, where they harassed the man's parents, the report said.

In another incident, a parcel of beef was put through the door of the family home which, being Hindus, they found very upsetting, the prosecution said.

In victim impact statements, the man's two sisters said they had suffered great stress for many years because of the harassment and one of them claimed that Amandeep Mudhar even got another child to bully her six-year-old son at school as part of her campaign of abuse.

Amandeep Mudhar and Sandeep Dogra had both pleaded guilty to harassment but avoided time behind bars as they were handed down two-year suspended jail sentences, which refers to a deferred custodial sentence on strict conditions.

She also faces a six-month curfew, during which her movements will be curtailed. She has also been directed to complete 100 hours of unpaid community service, attend rehabilitation days and pay 750 pounds towards legal costs.

The judge also imposed a restraining order banning Amandeep Mudhar and Sandeep Dogra from contacting the family, going to the roads they live on or the temple they visit.

"I hope this sentence draws a line in the sand and there will be no repetition. You have been warned, both of you," the judge said.

Amandeep Mudhar's lawyer highlighted her difficult childhood, during which her mother treated her harshly, and Sandeep Dogra's lawyer said that he became involved after he felt the victims had racially abused his mother.

The court was told that they both had been shunned by their local community after the details of the case had emerged earlier this year.