move swiftMailer registration into closure

Signed-off-by: Suhayb El Wardany <me@suw.me>