<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -53,6 +53,7 @@ module CapGun
     # This assumes Capistrano uses UTC for its date/timestamped directories, and converts to the local
     # machine timezone.
     def humanize_release_time(path)
+      return unless path
       match = path.match(/(\d+)$/)
       return unless match
       local = convert_from_utc(match[1])
@@ -86,8 +87,9 @@ module CapGun
       DEFAULT_EMAIL_PREFIX = &quot;[DEPLOY] &quot;
       
       adv_attr_accessor :email_prefix
+      attr_accessor :summary
       
-      # Grab the options for emaililng from cap_gun_email_envelope (should be set in your deploy file)
+      # Grab the options for emailing from cap_gun_email_envelope (should be set in your deploy file)
       #
       # Valid options:
       #     :recipients     (required) an array or string of email address(es) that should get notifications
@@ -102,16 +104,21 @@ module CapGun
       # Do the actual email
       def deployment_notification(capistrano)
         init(capistrano[:cap_gun_email_envelope])
+        self.summary = create_summary(capistrano)
         
         content_type &quot;text/plain&quot;
         subject &quot;#{email_prefix} #{capistrano[:application]} deployed to #{capistrano[:rails_env]}&quot;
         body    create_body(capistrano)
       end
       
+      def create_summary(capistrano)
+        %[#{capistrano[:application]} was deployed#{&quot; to &quot; &lt;&lt; capistrano[:rails_env] if capistrano[:rails_env]} by #{current_user} at #{humanize_release_time(capistrano[:current_release])}.]
+      end
+      
       # Create the body of the message using a bunch of values from Capistrano
       def create_body(capistrano)
 &lt;&lt;-EOL
-#{capistrano[:application]} was deployed to #{capistrano[:rails_env]} by #{current_user} at #{humanize_release_time(capistrano[:current_release])}.
+#{summary}
 
 Comment: #{capistrano[:comment] || &quot;[none given]&quot;}
 </diff>
      <filename>lib/cap_gun.rb</filename>
    </modified>
    <modified>
      <diff>@@ -110,10 +110,20 @@ describe &quot;CapGun&quot; do
       mail = CapGun::Mailer.create_deployment_notification capistrano
       mail.from.should == [&quot;booyakka!@example.com&quot;]
     end
-    
-    xit &quot;has a friendly summary line&quot;
+  end
+  
+  describe &quot;creating body&quot; do
+    it &quot;has a friendly summary line&quot; do
+      capistrano = { :application =&gt; &quot;my app&quot;, :rails_env =&gt; &quot;staging&quot;, :current_release =&gt; &quot;/data/foo/releases/20080227120000&quot;, :cap_gun_email_envelope =&gt; { :from =&gt; &quot;booyakka!@example.com&quot;, :recipients =&gt; [&quot;foo@here.com&quot;, &quot;bar@here.com&quot;] } }
+      mail = CapGun::Mailer.create_deployment_notification capistrano
+      mail.body.split(&quot;\n&quot;).first.should == &quot;my app was deployed to staging by rsanheim at February 27th, 2008 8:00 AM EDT.&quot;
+    end
 
-    xit &quot;does not include rails env in summary if not defined&quot;
+    it &quot;does not include rails env in summary if not defined&quot; do
+      capistrano = { :application =&gt; &quot;my app&quot;, :current_release =&gt; &quot;/data/foo/releases/20080227120000&quot;, :cap_gun_email_envelope =&gt; { :from =&gt; &quot;booyakka!@example.com&quot;, :recipients =&gt; [&quot;foo@here.com&quot;, &quot;bar@here.com&quot;] } }
+      mail = CapGun::Mailer.create_deployment_notification capistrano
+      mail.body.split(&quot;\n&quot;).first.should == &quot;my app was deployed by rsanheim at February 27th, 2008 8:00 AM EDT.&quot;
+    end
     
   end
   </diff>
      <filename>spec/cap_gun_spec.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>06a864c649542640e762d189defc3b6850b78315</id>
    </parent>
  </parents>
  <author>
    <name>Rob Sanheim</name>
    <email>rsanheim@gmail.com</email>
  </author>
  <url>http://github.com/relevance/cap_gun/commit/aebcb4fb709d414ce1aee409507fb97a398967cb</url>
  <id>aebcb4fb709d414ce1aee409507fb97a398967cb</id>
  <committed-date>2008-05-27T04:41:59-07:00</committed-date>
  <authored-date>2008-05-27T04:41:59-07:00</authored-date>
  <message>don't try to display rails env if its not set</message>
  <tree>4bebcc8da2d576f888a7976ed6fdb40be2f293aa</tree>
  <committer>
    <name>Rob Sanheim</name>
    <email>rsanheim@gmail.com</email>
  </committer>
</commit>
