rubyforgood/casa

View on GitHub
app/notifications/youth_birthday_notifier.rb

Summary

Maintainability
A
0 mins
Test Coverage
B
87%
# To deliver this notification:
#
# YouthBirthdayNotifier.with(post: @post).deliver(current_user)
#
class YouthBirthdayNotifier < BaseNotifier
  # deliver_by :email do |config|
  #   config.mailer = "UserMailer"
  #   ...
  # end
  # deliver_by :slack
  # deliver_by :custom, class: "MyDeliveryMethod"

  # Add required params
  required_param :casa_case

  # Define helper methods to make rendering easier.
  def message
    "Your youth, case number: #{params[:casa_case].case_number} has a birthday next month."
  end

  def title
    "Youth Birthday Notification"
  end

  def url
    casa_case_path(params[:casa_case].id)
  end
end