 slaveKey = null
 day = 24 * 60 * 60 * 1000
 
-pattern = /^encrypted/
+encryptionPattern = /^encrypted/
 
 sendEmail = (mailOptions, callback) ->
     transport = nodemailer.createTransport "SMTP", {}

    if obj?
        # Searching for fields to decrypt
        try
            obj[field] = @decrypt obj[field] for field in Object.keys(obj) \
                    when field.match pattern
            return obj
        catch error
            # Error are already logged by the decrypt function

    if obj?
        # Searching for fields to encrypt
        try
            for field in Object.keys(obj) when field.match encryptionPattern
                obj[field] = @encrypt obj[field]
            return obj
        catch error
            # Error are already logged by the encrypt function
