vrfs-775: formatting new musicians email

This commit is contained in:
Jonathan Kolyer 2013-11-26 03:08:22 -06:00
parent ee9b203f99
commit cde19cde56
4 changed files with 26 additions and 7 deletions

View File

@ -79,8 +79,8 @@
end
end
def new_musicians(user, new_nearby)
@user, @new_nearby = user, new_nearby
def new_musicians(user, new_nearby, host='www.jamkazam.com')
@user, @new_nearby, @host = user, new_nearby, host
sendgrid_unique_args :type => "new_musicians"
mail(:to => user.email, :subject => "JamKazam New Musicians in Your Area") do |format|
format.text

View File

@ -1,5 +1,23 @@
<% provide(:title, 'Confirm Email') %>
<% provide(:title, 'New JamKazam Musicians in your Area') %>
<p>New JamKazam Musicians in your Area, <%= @user.first_name %>!</p>
<p></p>
<% link_style = "background-color:#ED3618; margin:0px 8px 0px 8px; border: solid 1px #F27861; outline: solid 2px #ED3618; padding:3px 10px; font-family:raleway; font-size:12px; font-weight:300; cursor:pointer; color:#FC9; text-decoration:none;" %>
<p>
<table bgcolor="#242323" cellpadding="3px" cellspacing="5px">
<% @new_nearby.each do |user| %>
<tr valign="top">
<td width="10%"><img src="http://192.168.2.14:3001/assets/shared/avatar_generic.png" /></td>
<td width="20%"><font color="#ccc"><%= user.name %><br />
<%= user.location %></font><br />
<% user.musician_instruments.each do |inst| %>
<img src="http://<%= @host %>/assets/content/icon_instrument_<%= inst.id %>24.png" width="24" height="24" />
<% end %>
</td>
<td width="70%"><font color="#ccc"><%= user.biography %></font><br /><br />
<a style="<%= link_style %>" href="http://<%= @host %>/#/profile/<%= user.id %>">Profile</a>&nbsp;&nbsp;<!--<a style="<%= link_style %>" href="">Friend</a>-->
</td>
</tr>
<tr><td colspan="3"></td></tr>
<% end %>
</table>
</p>

View File

@ -257,7 +257,8 @@ module JamRuby
.within(radius, :origin => [usr.lat, usr.lng])
.order('created_at DESC')
.limit(max_count)
yield(rel) if 0 < rel.count
objs = rel.all.to_a
yield(objs) if 0 < objs.count
end
end

View File

@ -993,7 +993,7 @@ module JamRuby
def self.deliver_new_musician_notifications
self.geocoded_users.find_each do |usr|
Search.new_musicians(usr) do |new_nearby|
UserMailer.password_changed(self, new_nearby).deliver
UserMailer.new_musicians(self, new_nearby).deliver
end
end
end