In all cases of a motion to amerce a sheriff or other officer of any county, other than the one from which the execution issued, notice in writing shall be given to such officer as required in § 15-21-1 by leaving it with him or at his office at least fifteen days before the hearing of such motion; or by transmitting the notice by mail at least thirty days prior to the hearing thereof.
SDCL 15-21-3