Log full email body to DEBUG_EMAIL.
authorCarl Hetherington <cth@carlh.net>
Fri, 8 Apr 2016 22:49:26 +0000 (23:49 +0100)
committerCarl Hetherington <cth@carlh.net>
Fri, 8 Apr 2016 22:49:26 +0000 (23:49 +0100)
src/lib/cinema_kdms.cc
src/lib/emailer.h

index d7495e9ac2cab7217539071f96ad11038e5b3de1..318eebe3996af238156e3ce0e7c9b4bed9376faa 100644 (file)
@@ -174,12 +174,18 @@ CinemaKDMs::email (
                        email.send (c->mail_server(), c->mail_port(), c->mail_user(), c->mail_password());
                } catch (...) {
                        if (log) {
+                               log->log ("Email content follows", LogEntry::TYPE_DEBUG_EMAIL);
+                               log->log (email.email(), LogEntry::TYPE_DEBUG_EMAIL);
+                               log->log ("Email session follows", LogEntry::TYPE_DEBUG_EMAIL);
                                log->log (email.notes(), LogEntry::TYPE_DEBUG_EMAIL);
                        }
                        throw;
                }
 
                if (log) {
+                       log->log ("Email content follows", LogEntry::TYPE_DEBUG_EMAIL);
+                       log->log (email.email(), LogEntry::TYPE_DEBUG_EMAIL);
+                       log->log ("Email session follows", LogEntry::TYPE_DEBUG_EMAIL);
                        log->log (email.notes(), LogEntry::TYPE_DEBUG_EMAIL);
                }
        }
index 9d799c81ce639a68b68d8e88b4fa370744fa852b..5924e79b1d8c6c30a97dcb672077921aa2e59d62 100644 (file)
@@ -38,6 +38,11 @@ public:
        size_t get_data (void* ptr, size_t size, size_t nmemb);
        int debug (CURL* curl, curl_infotype type, char* data, size_t size);
 
+       /** @return full email, after send() has been called */
+       std::string email () const {
+               return _email;
+       }
+
        static std::string address_list (std::list<std::string> addresses);
 
 private: