diff --git a/include-env.cabal b/include-env.cabal
--- a/include-env.cabal
+++ b/include-env.cabal
@@ -1,5 +1,5 @@
 name:                include-env
-version:             0.1.3.0
+version:             0.2.0.0
 synopsis:            Include the value of an environment variable at compile time
 description:         Embed secrets (e.g. API keys) inside production artifacts at compile time.
 homepage:            https://github.com/unfoldml/include-env
diff --git a/src/IncludeEnv/TH.hs b/src/IncludeEnv/TH.hs
--- a/src/IncludeEnv/TH.hs
+++ b/src/IncludeEnv/TH.hs
@@ -19,7 +19,7 @@
 @
 
 -}
-module IncludeEnv.TH (includeEnv) where
+module IncludeEnv.TH (includeEnv, includeEnvLenient) where
 
 import System.Environment (lookupEnv)
 
@@ -49,5 +49,24 @@
         qpat = VarP (mkName n)
         qbody = NormalB (LitE (StringL x))
 
+-- | Like 'includeEnv' but only prints a warning if the environment variable cannot be found.
+--
+-- NB : If the lookup fails, the declared value will contain an empty string.
+includeEnvLenient :: String -- ^ name of environment variable to be looked up
+                  -> String -- ^ name of new value
+                  -> Q [Dec]
+includeEnvLenient e varname = do
+  mstr <- runIO $ lookupEnv e
+  case mstr of
+    Just str -> decl varname str
+    Nothing -> do
+      runIO $ putStrLn $ unwords ["*** WARNING : Cannot find variable", e, "in the environment."]
+      decl varname ""
+    where
+      decl :: String -> String -> Q [Dec]
+      decl n x = pure [dq] where
+        dq = ValD qpat qbody []
+        qpat = VarP (mkName n)
+        qbody = NormalB (LitE (StringL x))
 
 
