module Hoe::Publish

def generate_email full = nil

def generate_email full = nil
  require 'time'
  abort "No email 'to' entry. Run `rake config_hoe` to fix." unless
    !full || email_to
  from_name, from_email      = author.first, email.first
  subject, title, body, urls = announcement
  [
   full && "From: #{from_name} <#{from_email}>",
   full && "To: #{email_to.join(", ")}",
   full && "Date: #{Time.now.rfc2822}",
   "Subject: [ANN] #{subject}",
   "", title,
   "", urls,
   "", body,
  ].compact.join("\n")
end