# File lib/kwala/notifications/email.rb, line 5
  def unit_test(result, data, context)
    # TODO: Probably should move this to a configuration based
    from_addr = ""
    to_addr = [ "" ]
    smtp_server = ""
    smtp_port = 25

    # Get the time and set the status msg
    now = Time.now
    status_msg = "Unit tests run #{result.to_s} at"

    # just file name for now
    data ||= {}
    data = Array(data[:filtered_results]).map do |d|
      d[:file_name]
    end

    if !data.empty?
      failure_msg = "Test files that reported failures:\n\#{data.join(\"\\n\")}\n"
    else
      failure_msg = ''
    end

    # Create the SMTP envelope
    msgstr = "From: Kwala Continuous Integration <EMAIL>\nTo: Edge Dev Mailing List <EMAIL>\nSubject: [Kwala] edge build \#{context.vcs_num} \#{result}\nDate: \#{now.strftime(\"%a, %d %b %Y %X +0900\")}\nMessage-Id: <\#{now.strftime(\"%m%d%Y%H%M%S\")}@EMAIL>\n\nResult Summary:  \#{result.to_s}\nSee Results at https://BASEURL/kwala/\n\n\#{failure_msg}\n\nCommit Info:\n\#{context.vcs_info}\n"

    # Send the message
    Net::SMTP.start(smtp_server, smtp_port) do |smtp|
      smtp.send_message(msgstr, from_addr, *to_addr)
    end
  end