module ChangeManager class NotificationMailer < ActionMailer::Base def construct_email(changes) @body = prepare_body(changes) mail( to: changes.first.target, from: changes.first.owner, subject: 'Updates from Scholar@UC', ) end def send_email(constructed_email) constructed_email.deliver end def prepare_body(changes) header = '' body = '' footer = '
Change OwnerChange ContextChangeTime
' changes.each do |change| #may need a look up method from curate here body += '' + change.owner + '' + change.context + '' + change.change_type + '' + change.created_at.to_s + '' end content = header + body + footer end end end