Section 26. Whoever, without the consent of both parties to an intended marriage, gives the notice of their intention of marriage required by law shall be liable in damages to either of such parties whose name was so used without such consent. The superior court, upon petition of either party alleged to intend marriage in such a notice given without the consent of both parties, and not followed by their intermarriage, may, after notice and a hearing, order that such notice of intention be cancelled in the town records.