summaryrefslogtreecommitdiff
path: root/app/controllers/admin/mailer_controller.rb
diff options
context:
space:
mode:
authorDmitriy Zaporozhets <dzaporozhets@sphereconsultinginc.com>2011-10-09 00:36:38 +0300
committerDmitriy Zaporozhets <dzaporozhets@sphereconsultinginc.com>2011-10-09 00:36:38 +0300
commite98c77857f9f765d1854b92c2dc33049504a596d (patch)
tree52fbfc1cdb55df21843965479c97be0c91121a9a /app/controllers/admin/mailer_controller.rb
parent0f43e98ef8c2da8908b1107f75b67cda2572c2c4 (diff)
downloadgitlab-ce-0.9.4.tar.gz
init commitv0.9.4
Diffstat (limited to 'app/controllers/admin/mailer_controller.rb')
-rw-r--r--app/controllers/admin/mailer_controller.rb44
1 files changed, 44 insertions, 0 deletions
diff --git a/app/controllers/admin/mailer_controller.rb b/app/controllers/admin/mailer_controller.rb
new file mode 100644
index 00000000000..05ad267fad5
--- /dev/null
+++ b/app/controllers/admin/mailer_controller.rb
@@ -0,0 +1,44 @@
+class Admin::MailerController < ApplicationController
+ before_filter :authenticate_user!
+ before_filter :authenticate_admin!
+
+ def preview
+
+ end
+
+ def preview_note
+ @note = Note.first
+ @user = @note.author
+ @project = @note.project
+ case params[:type]
+ when "Commit" then
+ @commit = @project.commit
+ render :file => 'notify/note_commit_email.html.haml', :layout => 'notify'
+ when "Issue" then
+ @issue = Issue.first
+ render :file => 'notify/note_issue_email.html.haml', :layout => 'notify'
+ else
+ render :file => 'notify/note_wall_email.html.haml', :layout => 'notify'
+ end
+ rescue
+ render :text => "Preview not avaialble"
+ end
+
+ def preview_user_new
+ @user = User.first
+ @password = "DHasJKDHAS!"
+
+ render :file => 'notify/new_user_email.html.haml', :layout => 'notify'
+ rescue
+ render :text => "Preview not avaialble"
+ end
+
+ def preview_issue_new
+ @issue = Issue.first
+ @user = @issue.assignee
+ @project = @issue.project
+ render :file => 'notify/new_issue_email.html.haml', :layout => 'notify'
+ rescue
+ render :text => "Preview not avaialble"
+ end
+end