Sha256: 8b72db76b880125baf9b21ef7220c3d6968ed1cf5395df9937534b7895c745cb
Contents?: true
Size: 808 Bytes
Versions: 14
Compression:
Stored size: 808 Bytes
Contents
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 = '<table><th><td>Change Owner</td><td>Change Context</td><td>Change</td><td>Time</td></th>' body = '' footer = '</table>' changes.each do |change| #may need a look up method from curate here body += '<tr><td>' + change.owner + '</td><td>' + change.context + '</td><td>' + change.change_type + '</td><td>' + change.created_at.to_s + '</td></tr>' end content = header + body + footer end end end
Version data entries
14 entries across 14 versions & 1 rubygems