Action Mailer integration, key import

also added tests, finally