Commit 6b1ddc5e86321d27de427ed6dc1c2512b00add19
- Date: Fri Apr 18 09:29:23 +0000 2008
- Committer: Inge Jørgensen (inge@elektronaut.no)
- Author: Inge Jørgensen (inge@elektronaut.no)
- Commit SHA1: 6b1ddc5e86321d27de427ed6dc1c2512b00add19
- Tree SHA1: d8eaeae29ebeecf3a5cb482f57d25d6a426a0efb
Mail the user when someone adds him as a committer, no test. (Just playing around with git)
Commit diff
| |   |
| 25 | 25 | * only load scriptacolous+friends when needed |
| 26 | 26 | * git-blame rendering? |
| 27 | 27 | * Reword /about page |
| 28 | | * mail the user when someone adds him as a comitter |
| 28 | * mail the user when someone adds him as a comitter - add test |
| 29 | 29 | * expire fragment caches for project+repos on deletion |
| 30 | 30 | *a Tone down the "owner" of a repository, or implement a proper "mirror" project type. |
| 31 | 31 | *b be able to mark a project as a "mirror" |
| toggle raw diff |
--- a/TODO.txt
+++ b/TODO.txt
@@ -25,7 +25,7 @@ two from Yurii:
* only load scriptacolous+friends when needed
* git-blame rendering?
* Reword /about page
-* mail the user when someone adds him as a comitter
+* mail the user when someone adds him as a comitter - add test
* expire fragment caches for project+repos on deletion
*a Tone down the "owner" of a repository, or implement a proper "mirror" project type.
*b be able to mark a project as a "mirror" |
| |   |
| 21 | 21 | |
| 22 | 22 | respond_to do |format| |
| 23 | 23 | if @repository.add_committer(@committer) |
| 24 | Mailer.deliver_added_as_committer(@repository, @committer) |
| 24 | 25 | format.html { redirect_to([@repository.project, @repository]) } |
| 25 | 26 | format.xml do |
| 26 | 27 | render :xml => @committer |
| toggle raw diff |
--- a/app/controllers/committers_controller.rb
+++ b/app/controllers/committers_controller.rb
@@ -21,6 +21,7 @@ class CommittersController < ApplicationController
respond_to do |format|
if @repository.add_committer(@committer)
+ Mailer.deliver_added_as_committer(@repository, @committer)
format.html { redirect_to([@repository.project, @repository]) }
format.xml do
render :xml => @committer |
| |   |
| 38 | 38 | @body[:password] = password |
| 39 | 39 | end |
| 40 | 40 | |
| 41 | def added_as_committer(repository, user) |
| 42 | setup_email(user) |
| 43 | @subject += "You are now a committer on #{repository.project.slug}/#{repository.parent.name}" |
| 44 | @body[:repository] = repository |
| 45 | @body[:project] = repository.project |
| 46 | @body[:url] = "http://#{GitoriousConfig['gitorious_host']}/p/#{repository.project.slug}/repos/#{repository.name}" |
| 47 | end |
| 48 | |
| 41 | 49 | protected |
| 42 | 50 | def setup_email(user) |
| 43 | 51 | @recipients = "#{user.email}" |
| toggle raw diff |
--- a/app/models/mailer.rb
+++ b/app/models/mailer.rb
@@ -38,6 +38,14 @@ class Mailer < ActionMailer::Base
@body[:password] = password
end
+ def added_as_committer(repository, user)
+ setup_email(user)
+ @subject += "You are now a committer on #{repository.project.slug}/#{repository.parent.name}"
+ @body[:repository] = repository
+ @body[:project] = repository.project
+ @body[:url] = "http://#{GitoriousConfig['gitorious_host']}/p/#{repository.project.slug}/repos/#{repository.name}"
+ end
+
protected
def setup_email(user)
@recipients = "#{user.email}" |
| |   |
| 1 | Hello <%= @user.login -%>, |
| 2 | |
| 3 | You have been added as a committer on the <%= @repository.name -%> repository in the "<%= @project.title -%>" project. |
| 4 | |
| 5 | <%= @url %> |
| 6 | |
| 7 | Thank you |
| 8 | |
| 9 | http://<%= GitoriousConfig['gitorious_host'] %> |
| toggle raw diff |
--- /dev/null
+++ b/app/views/mailer/added_as_committer.rhtml
@@ -0,0 +1,9 @@
+Hello <%= @user.login -%>,
+
+You have been added as a committer on the <%= @repository.name -%> repository in the "<%= @project.title -%>" project.
+
+<%= @url %>
+
+Thank you
+
+http://<%= GitoriousConfig['gitorious_host'] %>
\ No newline at end of file |