require 'yaml' module ChangeManager class NotificationMailer < ActionMailer::Base CONFIG ||= YAML.load_file(File.join(Rails.root, 'config/change_manager_config.yml')) def construct_email(changes) @body = prepare_body(changes) mail( to: changes.first.target, from: changes.first.owner, subject: 'Recent Updates from ' + CONFIG['site_name'], ) end def send_email(constructed_email) constructed_email.deliver end def prepare_body(changes) header = '
Change Owner | Change Context | Change | Time | ' body = '' footer = '