class FriendMailer

Public Instance Methods

friend_request_email(id) click to toggle source

To send friend request email

# File app/mailers/friend_mailer.rb, line 18
def friend_request_email(id)
  @friend = ActsAsFriendable::Friendship.find(id)
  @time = @friend.created_at.day_month_date_hr_min_mer
  mail(to: @friend.friend.email, bcc: Configurations::General.bcc_list, subject: "Friend Request Email") do |format|
    format.html { render :layout => 'mailer' }
  end
end
friendship_request_status_email(friend_id) click to toggle source

Send email when friend request is accepted/rejected

# File app/mailers/friend_mailer.rb, line 4
def friendship_request_status_email(friend_id)
  @friend = ActsAsFriendable::Friendship.find(friend_id)
  if @friend.approved
    @request_status =  'Accepted'
  else
    @request_status =  'Rejected'
  end
  @time = @friend.created_at.day_month_date_hr_min_mer
  mail(to: @friend.user.email, bcc: Configurations::General.bcc_list, subject: "Friend Request #{@request_status}") do |format|
    format.html { render :layout => 'mailer' }
  end
end