Skip to content

Commit

Permalink
More email template stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
thurtt committed Apr 13, 2012
1 parent 4fd3bf7 commit b63baf8
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 69 deletions.
2 changes: 2 additions & 0 deletions app/mailers/event_mailer.rb
Expand Up @@ -8,6 +8,8 @@ def verification_email(event)
@url = "http://www.flyerzero.com/events/verify/#{@event.validation_hash}" @url = "http://www.flyerzero.com/events/verify/#{@event.validation_hash}"
@edit_url = "http://www.flyerzero.com/events/edit/#{@event.validation_hash}?event_id=#{event.id}" @edit_url = "http://www.flyerzero.com/events/edit/#{@event.validation_hash}?event_id=#{event.id}"
@del_url = "http://www.flyerzero.com/events/delete/#{@event.validation_hash}?event_id=#{event.id}" @del_url = "http://www.flyerzero.com/events/delete/#{@event.validation_hash}?event_id=#{event.id}"
attachments.inline['logo.png'] = Net::HTTP.get('flyerzero.com', '/assets/mainlogo-text.png')
attachments.inline['flyer.png'] = Net::HTTP.get('flyerzero.com', @event.photo.url(:thumb))
mail(:to => event.email, :subject => "Verify Your Event on Flyerzero") mail(:to => event.email, :subject => "Verify Your Event on Flyerzero")
end end


Expand Down
81 changes: 12 additions & 69 deletions app/views/event_mailer/verification_email.html.erb
@@ -1,97 +1,40 @@
<!DOCTYPE html> <!DOCTYPE html>
<html> <html>
<head> <head>
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type" /> <meta content="text/html; charset=UTF-8" http-equiv="Content-Type" />
<style type="text/css">
a:link {color:#000000;text-decoration:none;} /* unvisited link */
a:visited {color:#000000;text-decoration:none;} /* visited link */
a:hover {color:#000000;text-decoration:none;} /* mouse over link */
a:active {color:#000000;text-decoration:none;} /* selected link */
.outer_border{
background:#000000;
padding:30px;
margin:50px;
border-radius: 5px;
}
.inner_content{
background:#fcfcfc;
padding: 10px;
border-top-left-radius: 5px;
border-top-right-radius: 5px;
}
.button{
width: 75px;
border: 1px solid #bbbbbb;
background: #cccccc;
text-align: center;
font-size: 1.2em;
border-radius: 5px;
padding: 5px;
}
.button:hover{
background: #000000;
color: #fcfcfc;
cursor: pointer;

}
.footer{
background: #f9e101;
border-bottom-left-radius: 5px;
border-bottom-right-radius: 5px;
text-align: center;
padding-top: 10px;
padding-bottom: 10px;
}
.header{
background: #f9e101;
//border-top-left-radius: 5px;
//border-top-right-radius: 5px;
border-radius: 5px;
text-align: center;
padding: 10px;
margin-bottom: 20px;
font-size: 2em;
font-weight: 800;
}
.cool_points{
color: #ff0000;
font-weight: 700;
}
</style>
</head> </head>
<body> <body>
<div class="outer_border"> <div style="background:#000000;padding:30px;margin:50px;border-radius: 5px;">
<img src="http://flyerzero.com/assets/mainlogo-text.png" /> <%= image_tag attachments['logo.png'].url %>
<div class="header">Thanks for submitting an event on Flyerzero!</div> <div style="background: #f9e101;border-radius: 5px;text-align: center;padding: 10px;margin-bottom: 20px;font-size: 2em;font-weight: 800;">Thanks for submitting an event on Flyerzero!</div>
<div class="inner_content"> <div style="background:#fcfcfc;padding:10px;border-top-left-radius: 5px;border-top-right-radius: 5px;">


<h2>Your Event</h2> <h2>Your Event</h2>
<table> <table>
<tr> <tr>
<td rowspan="4"> <td rowspan="4">
<img src="<%= @event.photo.url(:thumb) %>" /> <%= image_tag attachments['flyer.png'].url %>
<div>Event Date: <%= @event.expiry.strftime("%m/%d/%Y") %></div> <div>Event Date: <%= @event.expiry.strftime("%m/%d/%Y") %></div>
<div>Event Location: <%= foursquare_venue @event.venue_id %></div> <div>Event Location: <%= foursquare_venue @event.venue_id %></div>
</td> </td>
<td><a href="<%= @url %>"><div class="button">Activate</div></a></td> <td><a href="<%= @url %>" style="text-decoration:none; color:#000000;"><div style="width:75px;border:1px solid #bbbbbb;background:#cccccc;text-align: center;font-size: 1.2em;border-radius:5px;padding:5px;">Activate</div></a></td>
<td>Before your event can show up on the Zero board and map, you need to activate it.</td> <td>Before your event can show up on the Zero board and map, you need to activate it.</td>
</tr> </tr>
<tr> <tr>
<td><a href="<%= @edit_url %>"><div class="button">Edit</div></a></td> <td><a href="<%= @edit_url %>" style="text-decoration:none; color:#000000;"><div style="width:75px;border:1px solid #bbbbbb;background:#cccccc;text-align: center;font-size: 1.2em;border-radius:5px;padding:5px;">Edit</div></a></td>
<td>You can edit your event at any time before it expires by clicking this link</td> <td>You can edit your event at any time before it expires by clicking this link</td>
</tr> </tr>
<tr> <tr>
<td><a href="<%= @del_url %>"><div class="button">Delete</div></a></td> <td><a href="<%= @del_url %> style="text-decoration:none; color:#000000;""><div style="width:75px;border:1px solid #bbbbbb;background:#cccccc;text-align: center;font-size: 1.2em;border-radius:5px;padding:5px;">Delete</div></a></td>
<td>You can delete your event any time</td> <td>You can delete your event any time</td>
</tr> </tr>
</table> </table>
<h2>Your Profile</h2> <h2>Your Profile</h2>
<img src="<%= gravatar_url( @event.email, :r=>'pg', :d=>'mm') %>" /> <%= image_tag gravatar_url( @event.email, :r=>'pg', :d=>'mm' ) %>
<p><%= @event.email %> </p> <p><%= @event.email %> </p>
<p> You currently have <span class="cool_points"><%= @achievements ? @achievements.points : '0' %></span> cool points</p> <p> You currently have <span style="color: #ff0000;font-weight: 700;"><%= @achievements ? @achievements.points : '0' %></span> cool points</p>

</div> </div>
<div class="footer">Flyerzero is a kickass <a href="http://www.openformfoundation.org/">Open Form Foundation</a> joint.</div> <div style="background:#f9e101;border-bottom-left-radius: 5px;border-bottom-right-radius: 5px;text-align: center;padding-top: 10px;padding-bottom: 10px;">Flyerzero is a kickass <a href="http://www.openformfoundation.org/">Open Form Foundation</a> joint.</div>
</div> </div>
</body> </body>
</html> </html>

0 comments on commit b63baf8

Please sign in to comment.