has been given against the defendant on motion for judgment on the pleadings, the defendant may give in evidence, in mitigation of damages, that he or she made or offered a written or printed apology to the plaintiff for the defamation before the commencement of the action or, if the action was commenced before there was an opportunity of making or offering the apology, as soon afterwards as the d