Merge branch 'develop' of bitbucket.org:jamkazam/jam-cloud into develop
This commit is contained in:
commit
1a7e63d50a
|
|
@ -141,3 +141,4 @@ notification_seen_at.sql
|
|||
order_event_session.sql
|
||||
emails.sql
|
||||
email_batch.sql
|
||||
user_progress_tracking2.sql
|
||||
|
|
|
|||
|
|
@ -0,0 +1,3 @@
|
|||
-- tracks how users are progessing through the site: https://jamkazam.atlassian.net/wiki/pages/viewpage.action?pageId=3375145
|
||||
|
||||
ALTER TABLE users ADD COLUMN first_liked_us TIMESTAMP;
|
||||
|
|
@ -11,6 +11,7 @@ module JamRuby
|
|||
|
||||
sendgrid_recipients(emails)
|
||||
sendgrid_substitute(EmailBatch::VAR_FIRST_NAME, users.map(&:first_name))
|
||||
sendgrid_substitute('@USERID', users.map(&:id))
|
||||
|
||||
batch.did_send(emails)
|
||||
|
||||
|
|
|
|||
|
|
@ -26,6 +26,9 @@ module JamRuby
|
|||
sendgrid_category "Corporate"
|
||||
sendgrid_unique_args :type => "feedback"
|
||||
|
||||
sendgrid_recipients([@email])
|
||||
sendgrid_substitute('@USERID', [User.id_for_email(@email)])
|
||||
|
||||
mail(:to => "info@jamkazam.com", :subject => "Feedback received from #{@email} ") do |format|
|
||||
format.text
|
||||
format.html
|
||||
|
|
|
|||
|
|
@ -23,6 +23,9 @@ module JamRuby
|
|||
@signup_url = generate_signup_url(invited_user)
|
||||
@suppress_user_has_account_footer = true
|
||||
|
||||
sendgrid_recipients([invited_user.email])
|
||||
sendgrid_substitute('@USERID', [invited_user.id])
|
||||
|
||||
sendgrid_category "Welcome"
|
||||
sendgrid_unique_args :type => "welcome_betauser"
|
||||
|
||||
|
|
|
|||
|
|
@ -25,6 +25,9 @@
|
|||
sendgrid_category "Confirm Email"
|
||||
sendgrid_unique_args :type => "confirm_email"
|
||||
|
||||
sendgrid_recipients([user.email])
|
||||
sendgrid_substitute('@USERID', [user.id])
|
||||
|
||||
mail(:to => user.email, :subject => "Please confirm your JamKazam email") do |format|
|
||||
format.text
|
||||
format.html
|
||||
|
|
@ -36,6 +39,9 @@
|
|||
sendgrid_category "Welcome"
|
||||
sendgrid_unique_args :type => "welcome_message"
|
||||
|
||||
sendgrid_recipients([user.email])
|
||||
sendgrid_substitute('@USERID', [user.id])
|
||||
|
||||
mail(:to => user.email, :subject => "Welcome to JamKazam") do |format|
|
||||
format.text
|
||||
format.html
|
||||
|
|
@ -44,6 +50,10 @@
|
|||
|
||||
def password_changed(user)
|
||||
@user = user
|
||||
|
||||
sendgrid_recipients([user.email])
|
||||
sendgrid_substitute('@USERID', [user.id])
|
||||
|
||||
sendgrid_unique_args :type => "password_changed"
|
||||
mail(:to => user.email, :subject => "JamKazam Password Changed") do |format|
|
||||
format.text
|
||||
|
|
@ -53,6 +63,10 @@
|
|||
|
||||
def password_reset(user, password_reset_url)
|
||||
@user = user
|
||||
|
||||
sendgrid_recipients([user.email])
|
||||
sendgrid_substitute('@USERID', [user.id])
|
||||
|
||||
@password_reset_url = password_reset_url
|
||||
sendgrid_unique_args :type => "password_reset"
|
||||
mail(:to => user.email, :subject => "JamKazam Password Reset") do |format|
|
||||
|
|
@ -63,6 +77,10 @@
|
|||
|
||||
def updating_email(user)
|
||||
@user = user
|
||||
|
||||
sendgrid_recipients([user.email])
|
||||
sendgrid_substitute('@USERID', [user.id])
|
||||
|
||||
sendgrid_unique_args :type => "updating_email"
|
||||
mail(:to => user.update_email, :subject => "JamKazam Email Change Confirmation") do |format|
|
||||
format.text
|
||||
|
|
@ -72,6 +90,10 @@
|
|||
|
||||
def updated_email(user)
|
||||
@user = user
|
||||
|
||||
sendgrid_recipients([user.email])
|
||||
sendgrid_substitute('@USERID', [user.id])
|
||||
|
||||
sendgrid_unique_args :type => "updated_email"
|
||||
mail(:to => user.email, :subject => "JamKazam Email Changed") do |format|
|
||||
format.text
|
||||
|
|
@ -81,6 +103,10 @@
|
|||
|
||||
def new_musicians(user, new_nearby, host='www.jamkazam.com')
|
||||
@user, @new_nearby, @host = user, new_nearby, host
|
||||
|
||||
sendgrid_recipients([user.email])
|
||||
sendgrid_substitute('@USERID', [user.id])
|
||||
|
||||
sendgrid_unique_args :type => "new_musicians"
|
||||
mail(:to => user.email, :subject => "JamKazam New Musicians in Your Area") do |format|
|
||||
format.text
|
||||
|
|
@ -97,6 +123,10 @@
|
|||
@body = msg
|
||||
sendgrid_category "Notification"
|
||||
sendgrid_unique_args :type => unique_args[:type]
|
||||
|
||||
sendgrid_recipients([email])
|
||||
sendgrid_substitute('@USERID', [User.id_for_email(email)])
|
||||
|
||||
mail(:to => email, :subject => subject) do |format|
|
||||
format.text
|
||||
format.html
|
||||
|
|
@ -110,6 +140,10 @@
|
|||
@body = msg
|
||||
sendgrid_category "Notification"
|
||||
sendgrid_unique_args :type => unique_args[:type]
|
||||
|
||||
sendgrid_recipients([email])
|
||||
sendgrid_substitute('@USERID', [User.id_for_email(email)])
|
||||
|
||||
mail(:to => email, :subject => subject) do |format|
|
||||
format.text
|
||||
format.html
|
||||
|
|
@ -123,6 +157,10 @@
|
|||
@body = msg
|
||||
sendgrid_category "Notification"
|
||||
sendgrid_unique_args :type => unique_args[:type]
|
||||
|
||||
sendgrid_recipients([email])
|
||||
sendgrid_substitute('@USERID', [User.id_for_email(email)])
|
||||
|
||||
mail(:to => email, :subject => subject) do |format|
|
||||
format.text
|
||||
format.html
|
||||
|
|
@ -136,6 +174,10 @@
|
|||
@body = msg
|
||||
sendgrid_category "Notification"
|
||||
sendgrid_unique_args :type => unique_args[:type]
|
||||
|
||||
sendgrid_recipients([email])
|
||||
sendgrid_substitute('@USERID', [User.id_for_email(email)])
|
||||
|
||||
mail(:bcc => email, :subject => subject) do |format|
|
||||
format.text
|
||||
format.html
|
||||
|
|
@ -149,6 +191,10 @@
|
|||
@body = msg
|
||||
sendgrid_category "Notification"
|
||||
sendgrid_unique_args :type => unique_args[:type]
|
||||
|
||||
sendgrid_recipients([email])
|
||||
sendgrid_substitute('@USERID', [User.id_for_email(email)])
|
||||
|
||||
mail(:to => email, :subject => subject) do |format|
|
||||
format.text
|
||||
format.html
|
||||
|
|
@ -162,6 +208,10 @@
|
|||
@session_url = "#{APP_CONFIG.external_root_url}/sessions/#{session_id}"
|
||||
sendgrid_category "Notification"
|
||||
sendgrid_unique_args :type => unique_args[:type]
|
||||
|
||||
sendgrid_recipients([email])
|
||||
sendgrid_substitute('@USERID', [User.id_for_email(email)])
|
||||
|
||||
mail(:bcc => email, :subject => subject) do |format|
|
||||
format.text
|
||||
format.html
|
||||
|
|
@ -176,6 +226,10 @@
|
|||
@session_url = "#{APP_CONFIG.external_root_url}/sessions/#{session_id}"
|
||||
sendgrid_category "Notification"
|
||||
sendgrid_unique_args :type => unique_args[:type]
|
||||
|
||||
sendgrid_recipients([email])
|
||||
sendgrid_substitute('@USERID', [User.id_for_email(email)])
|
||||
|
||||
mail(:bcc => email, :subject => subject) do |format|
|
||||
format.text
|
||||
format.html
|
||||
|
|
@ -189,6 +243,10 @@
|
|||
@body = msg
|
||||
sendgrid_category "Notification"
|
||||
sendgrid_unique_args :type => unique_args[:type]
|
||||
|
||||
sendgrid_recipients([email])
|
||||
sendgrid_substitute('@USERID', [User.id_for_email(email)])
|
||||
|
||||
mail(:bcc => email, :subject => subject) do |format|
|
||||
format.text
|
||||
format.html
|
||||
|
|
@ -202,6 +260,10 @@
|
|||
@body = msg
|
||||
sendgrid_category "Notification"
|
||||
sendgrid_unique_args :type => unique_args[:type]
|
||||
|
||||
sendgrid_recipients([email])
|
||||
sendgrid_substitute('@USERID', [User.id_for_email(email)])
|
||||
|
||||
mail(:bcc => email, :subject => subject) do |format|
|
||||
format.text
|
||||
format.html
|
||||
|
|
@ -215,6 +277,10 @@
|
|||
@body = msg
|
||||
sendgrid_category "Notification"
|
||||
sendgrid_unique_args :type => unique_args[:type]
|
||||
|
||||
sendgrid_recipients([email])
|
||||
sendgrid_substitute('@USERID', [User.id_for_email(email)])
|
||||
|
||||
mail(:to => email, :subject => subject) do |format|
|
||||
format.text
|
||||
format.html
|
||||
|
|
@ -228,6 +294,10 @@
|
|||
@body = msg
|
||||
sendgrid_category "Notification"
|
||||
sendgrid_unique_args :type => unique_args[:type]
|
||||
|
||||
sendgrid_recipients([email])
|
||||
sendgrid_substitute('@USERID', [User.id_for_email(email)])
|
||||
|
||||
mail(:to => email, :subject => subject) do |format|
|
||||
format.text
|
||||
format.html
|
||||
|
|
@ -246,6 +316,10 @@
|
|||
@sender_photo_url = sender_photo_url
|
||||
sendgrid_category "Notification"
|
||||
sendgrid_unique_args :type => unique_args[:type]
|
||||
|
||||
sendgrid_recipients([email])
|
||||
sendgrid_substitute('@USERID', [User.id_for_email(email)])
|
||||
|
||||
mail(:to => email, :subject => subject) do |format|
|
||||
format.text
|
||||
format.html { render :layout => "from_user_mailer" }
|
||||
|
|
|
|||
|
|
@ -47,6 +47,13 @@
|
|||
<% end %>
|
||||
</table>
|
||||
<table align="center" width="650" cellpadding="10" bgcolor="#156572" cellspacing="0">
|
||||
<tr>
|
||||
<td align="center" valign="top">
|
||||
<% [:twitter, :facebook, :google].each do |src| %>
|
||||
<%= link_to(image_tag("http://www.jamkazam.com/assets/content/icon_#{src}.png", :style => "vertical-align:top"), "http://www.jamkazam.com/endorse/@USERID/#{src}") %>
|
||||
<% end %>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="center"><font size="1" color="#ffffff" face="Arial, Helvetica, sans-serif">Copyright © <%= Time.now.year %> JamKazam, Inc. All rights reserved.</font>
|
||||
</td>
|
||||
|
|
|
|||
|
|
@ -1174,6 +1174,10 @@ module JamRuby
|
|||
# self.password_digest = encrypted_password
|
||||
#end
|
||||
|
||||
def self.id_for_email(email)
|
||||
User.where(:email => email).limit(1).pluck(:id).first
|
||||
end
|
||||
|
||||
# end devise compatibility
|
||||
private
|
||||
def create_remember_token
|
||||
|
|
|
|||
|
|
@ -368,6 +368,23 @@ class UsersController < ApplicationController
|
|||
render :layout => "landing"
|
||||
end
|
||||
|
||||
def endorse
|
||||
if uu = User.where(['id = ? AND first_liked_us IS NULL',params[:id]]).limit(1).first
|
||||
uu.first_liked_us = Time.now
|
||||
uu.save!
|
||||
end if params[:id].present?
|
||||
|
||||
url, service = 'http://www.jamkazam.com', params[:service]
|
||||
if 'twitter'==service
|
||||
url = 'https://twitter.com/jamkazam'
|
||||
elsif 'facebook'==service
|
||||
url = 'https://www.facebook.com/JamKazam'
|
||||
elsif 'google'==service
|
||||
url = 'https://plus.google.com/u/0/106619885929396862606/about'
|
||||
end
|
||||
redirect_to url
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def is_native_client
|
||||
|
|
|
|||
|
|
@ -65,6 +65,8 @@ SampleApp::Application.routes.draw do
|
|||
|
||||
match '/video/dialog/:id', to: 'videos#show', :via => :get
|
||||
|
||||
match '/endorse/:id/:service', to: 'users#endorse', :as => 'endorse'
|
||||
|
||||
# temporarily allow for debugging--only allows admini n
|
||||
match '/listen_in', to: 'spikes#listen_in'
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue