forked from External/greenlight
Send an email to the user when a recording is done processing
Had to add an email attribute to users to store their email to send the notification. Will only send it for user rooms since they are the only ones we know who to notify.
This commit is contained in:
@ -21,6 +21,7 @@ class User < ApplicationRecord
|
||||
def self.from_omniauth(auth_hash)
|
||||
user = find_or_initialize_by(uid: auth_hash['uid'], provider: auth_hash['provider'])
|
||||
user.username = self.send("#{auth_hash['provider']}_username", auth_hash) rescue nil
|
||||
user.email = self.send("#{auth_hash['provider']}_email", auth_hash) rescue nil
|
||||
user.name = auth_hash['info']['name']
|
||||
user.save!
|
||||
user
|
||||
@ -30,10 +31,18 @@ class User < ApplicationRecord
|
||||
auth_hash['info']['nickname']
|
||||
end
|
||||
|
||||
def self.twitter_email(auth_hash)
|
||||
auth_hash['info']['email']
|
||||
end
|
||||
|
||||
def self.google_username(auth_hash)
|
||||
auth_hash['info']['email'].split('@').first
|
||||
end
|
||||
|
||||
def self.google_email(auth_hash)
|
||||
auth_hash['info']['email']
|
||||
end
|
||||
|
||||
def room_url
|
||||
"/rooms/#{encrypted_id}"
|
||||
end
|
||||
|
Reference in New Issue
Block a user