rubyforgood/casa

View on GitHub
lib/mailers/previews/learning_hours_mailer_preview.rb

Summary

Maintainability
A
15 mins
Test Coverage
require_relative "../debug_preview_mailer"

class LearningHoursMailerPreview < ActionMailer::Preview
  def learning_hours_report_email
    current_user = params.has_key?(:id) ? User.find_by(id: params[:id]) : User.first

    if current_user.nil?
      DebugPreviewMailer.invalid_user("user")
    else
      LearningHoursMailer.learning_hours_report_email(current_user)
    end
  end
end