 import Foundation
 
 public struct Email {
+    public static var DebugMode = false
+
+    public struct Events {
+        public class Sent: EventType { public typealias CallbackParam = Email }
+    }
+
     public struct Builder {
         let id: String
 

            print("Sending email to '\(self.recipient)' with subject '\(self.subject)'")
            let file = try self.file()

            #if os(Linux)
                let _ = try file.createFile(containing: self.body.data(using: .utf8), canOverwrite: true)
                let task = Process()
                task.launchPath = "/bin/sh"

                task.launch()
                task.waitUntilExit()
                let _ = try? file.file?.delete()
                guard task.terminationStatus == 0 else {
                    return false
                }
                EventCenter.defaultCenter().triggerEvent(Events.Sent.self, params: self)
                return true
            #else
                return try debug()
            #endif

        }
