Hacker News new | ask | show | jobs
by buffoon 3917 days ago
This is pretty much how we deal with this in a DI framework anyway. The constructor of the transport takes the host and the send method takes the message.

   emailSender = SMTPSender(host='localhost') # in container
   emailSender.send(message)                  # in implementation
The consumer of the SMTPSender only interacts with the send() method.