Louise Pryke told the court her son had since been acquitted of the allegation after the trial was halted due to unreliable evidence.
Riley pleaded guilty to conveying a prohibited article into prison. She was given an eight-month prison sentence, suspended for one year.
She was also ordered to do 100 hours unpaid work and take part in an activity programme designed to address her offending.
James Littlehayles, mitigating, said Riley, who has convictions for minor offences including drink driving, did not commit the offence for financial gain and had not abused a position of trust.
The court heard Riley has two other children, including a younger son who was suffering from serious health problem, who would suffer greatly if she was sent to prison.
Recorder Cran told Riley there were significant mitigating factors which enabled him not to send her to prison. He said: "You accept that your behaviour was very foolish indeed. You need to be with your son and 11-year-old daughter."