integrate mailer to controller