-
Notifications
You must be signed in to change notification settings - Fork 1
/
init.rb
23 lines (19 loc) · 881 Bytes
/
init.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
require 'redmine'
Redmine::Plugin.register :redmine_project_specific_email_sender do
name 'Redmine Project Specific Email Sender plugin'
author 'Adam Walters'
description "This is a plugin for Redmine which allows each project to have it's own sender email address for project related, outbound emails"
version '1.0.0'
permission :edit_project_email, :project_emails => [:update, :destroy]
end
prepare_block = Proc.new do
Project.send(:include, RedmineProjectSpecificEmailSender::ProjectPatch)
Mailer.send(:include, RedmineProjectSpecificEmailSender::MailerPatch)
ProjectsHelper.send(:include, RedmineProjectSpecificEmailSender::ProjectsHelperPatch)
end
if Rails.env.development?
ActionDispatch::Reloader.to_prepare { prepare_block.call }
else
prepare_block.call
end
ActionMailer::Base.register_interceptor(RedmineProjectSpecificEmailSender::Interceptor)