modify the mailing logic