Except as otherwise provided in rule 18.07 of the Rules of Criminal Procedure, every judge, grand juror, county attorney, court administrator, or other officer, who, except in the due discharge of official duty, shall disclose, before an accused person shall be in custody, the fact that an indictment found or ordered against the accused person, and every grand juror who, except when lawfully required by a court or officer, shall willfully disclose any evidence adduced before the grand jury, or anything which the juror or any other member of the grand jury said, or in what manner any grand juror voted upon any matter before them, shall be guilty of a misdemeanor. Disclosure may be made by the county attorney, by notice to the defendant or the defendant’s attorney of the indictment and the time of defendant’s appearance in the district court, if in the discretion of the judge notice is sufficient to insure defendant’s appearance.