change signature of doSendEmail