Created
July 1, 2015 19:03
-
-
Save eovolkov/cf50920293a5db62c530 to your computer and use it in GitHub Desktop.
email_notification
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def email_notification_params | |
{ | |
reader: @reader_with_book.name, | |
book: @reader_with_book.book.title, | |
author: @reader_with_book.book.author.transliterate, | |
hours_to_deadline: @reader_with_book.hours_to_deadline(@issue_datetime), | |
penalty: @reader_with_book.book.price_per_hour | |
} | |
end | |
def email_notification | |
params = email_notification_params | |
<<-TEXT | |
Hello, #{params[:reader]}! | |
You should return a book #{params[:book]} authored by #{params[:author]} in #{params[:hours_to_deadline]} hours. | |
Otherwise you will be charged #{params[:penalty]} per hour. | |
TEXT | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment