From 2db7bf638bc30b624ede83d1e6a55895cdbe3111 Mon Sep 17 00:00:00 2001 From: Taylor Griffin Date: Mon, 9 Feb 2015 20:41:28 +1100 Subject: [PATCH] improve copy for new request email --- app/controllers/crops_controller.rb | 2 +- app/mailers/notifier.rb | 2 +- app/views/notifier/new_crop_request.html.haml | 23 ++++++++++++++++--- db/schema.rb | 1 + 4 files changed, 23 insertions(+), 5 deletions(-) diff --git a/app/controllers/crops_controller.rb b/app/controllers/crops_controller.rb index 19f55d7ef..2c64f5cc8 100644 --- a/app/controllers/crops_controller.rb +++ b/app/controllers/crops_controller.rb @@ -123,7 +123,7 @@ class CropsController < ApplicationController respond_to do |format| if @crop.save - if current_member.has_role? :crop_wrangler + unless current_member.has_role? :crop_wrangler Role.crop_wranglers.each do |w| Notifier.new_crop_request(w, @crop).deliver! end diff --git a/app/mailers/notifier.rb b/app/mailers/notifier.rb index 88c5f50f5..53bae3092 100644 --- a/app/mailers/notifier.rb +++ b/app/mailers/notifier.rb @@ -24,7 +24,7 @@ class Notifier < ActionMailer::Base def new_crop_request(member, request) @member, @request = member, request - mail(:to => @member.email, :subject => "New crop request") + mail(:to => @member.email, :subject => "#{@request.requester.login_name} has requested #{@request.name} as a new crop") end def crop_request_approved(member, crop) diff --git a/app/views/notifier/new_crop_request.html.haml b/app/views/notifier/new_crop_request.html.haml index 2fc16df7d..26b63f8ff 100644 --- a/app/views/notifier/new_crop_request.html.haml +++ b/app/views/notifier/new_crop_request.html.haml @@ -1,7 +1,24 @@ - site_name = ENV['GROWSTUFF_SITE_NAME'] + %p Hello #{@member.login_name}, -%p - A new crop has been requested. View, edit, approve or reject the request: +%p + #{@request.requester.login_name} has requested a new crop on #{site_name}. - = link_to "Request for #{@request}", crop_url(@request) +%ul + %li Name: #{@request.name} + %li Wikipedia URL: #{@request.en_wikipedia_url.present? ? @request.en_wikipedia_url : "not specified"} + +%p + As a crop wrangler, you can #{link_to "approve or reject this request", edit_crop_url(@request)}. + +%p + Or, discuss this and other crop wrangling issues in our #{link_to "crop wrangling forum", "http://talk.growstuff.org/c/crop-wrangling"}. + +%p + Thanks for your help! + +%p + The Growstuff (staging) team + %br/ + =link_to root_url, root_url \ No newline at end of file diff --git a/db/schema.rb b/db/schema.rb index ebafd6fa2..4d3f407b9 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -285,6 +285,7 @@ ActiveRecord::Schema.define(version: 20150201064502) do t.datetime "updated_at" t.string "slug" t.integer "forum_id" + t.integer "parent_id" end add_index "posts", ["created_at", "author_id"], name: "index_posts_on_created_at_and_author_id", using: :btree