VRFS-1247 include Listen link in session emails

This commit is contained in:
Brian Smith 2014-02-27 00:00:01 -05:00
parent f77965b851
commit 09899e8f0a
6 changed files with 10 additions and 9 deletions

View File

@ -154,11 +154,11 @@
end
end
def musician_session_join(email, msg)
def musician_session_join(email, msg, session_id)
subject = "Someone you know is in a session on JamKazam"
unique_args = {:type => "musician_session_join"}
@body = msg
@session_url = "#{APP_CONFIG.external_root_url}/sessions/#{session_id}"
sendgrid_category "Notification"
sendgrid_unique_args :type => unique_args[:type]
mail(:bcc => email, :subject => subject) do |format|
@ -167,11 +167,12 @@
end
end
def band_session_join(email, msg)
def band_session_join(email, msg, session_id)
subject = "A band that you follow has joined a session"
unique_args = {:type => "band_session_join"}
@body = msg
@session_url = "#{APP_CONFIG.external_root_url}/sessions/#{session_id}"
sendgrid_category "Notification"
sendgrid_unique_args :type => unique_args[:type]
mail(:bcc => email, :subject => subject) do |format|

View File

@ -1,3 +1,3 @@
<% provide(:title, 'New Band Session') %>
<p><%= @body %></p>
<p><%= @body %>&nbsp;<a href="<%= @session_url %>">Listen in.</a></p>

View File

@ -1 +1 @@
<%= @body %>
<%= @body %> Listen at <%= @session_url %>.

View File

@ -1,3 +1,3 @@
<% provide(:title, 'Musician in Session') %>
<p><%= @body %></p>
<p><%= @body %>&nbsp;<a href="<%= @session_url %>">Listen in.</a></p>

View File

@ -1 +1 @@
<%= @body %>
<%= @body %> Listen at <%= @session_url %>.

View File

@ -507,7 +507,7 @@ module JamRuby
# send email notifications
unless offline_ff.empty?
begin
UserMailer.musician_session_join(offline_ff.map! {|f| f.email}, notification_msg).deliver if APP_CONFIG.send_join_session_email_notifications
UserMailer.musician_session_join(offline_ff.map! {|f| f.email}, notification_msg, music_session.id).deliver if APP_CONFIG.send_join_session_email_notifications
rescue => e
@@log.error("unable to send email to offline participants #{e}")
end
@ -552,7 +552,7 @@ module JamRuby
# send email notifications
unless offline_followers.empty?
UserMailer.band_session_join(offline_followers.map! {|f| f.email}, notification_msg).deliver
UserMailer.band_session_join(offline_followers.map! {|f| f.email}, notification_msg, music_session.id).deliver if APP_CONFIG.send_join_session_email_notifications
end
end
end