]> git.openstreetmap.org Git - rails.git/commitdiff
Reduce welcome email to minimal text
authorJohn Firebaugh <john.firebaugh@gmail.com>
Tue, 16 Jul 2013 00:53:03 +0000 (17:53 -0700)
committerJohn Firebaugh <john.firebaugh@gmail.com>
Mon, 12 Aug 2013 20:34:40 +0000 (13:34 -0700)
Instead, redirect newly-confirmed users to the welcome
page. If confirmation is not required, redirect immediately
and don't send an email.

app/controllers/user_controller.rb
app/models/notifier.rb
app/views/notifier/signup_confirm.html.erb
app/views/notifier/signup_confirm.text.erb
config/locales/en.yml
config/routes.rb
test/integration/user_creation_test.rb

index 57d2f7d132c299f4f323959b491cc8b644b2b597..df0c8d841ba65e3a115b31e881923ea9709b5cc9 100644 (file)
@@ -90,15 +90,14 @@ class UserController < ApplicationController
 
           if @user.status == "active"
             flash[:notice] = t 'user.new.flash welcome', :email => @user.email
-
-            Notifier.signup_confirm(@user, nil).deliver
+            session[:referer] = welcome_path
 
             successful_login(@user)
           else
             flash[:notice] = t 'user.new.flash create success message', :email => @user.email
             session[:token] = @user.tokens.create.token
 
-            Notifier.signup_confirm(@user, @user.tokens.create(:referer => session.delete(:referer))).deliver
+            Notifier.signup_confirm(@user, @user.tokens.create(:referer => welcome_path)).deliver
 
             redirect_to :action => 'login', :referer => params[:referer]
           end
index a5092221453c50b93f7016afd72e8580b3c3ec5f..be6679c41b74cd6730134e2dc629e19a48efc634 100644 (file)
@@ -6,18 +6,10 @@ class Notifier < ActionMailer::Base
 
   def signup_confirm(user, token)
     with_recipient_locale user do
-      # If we are passed an email address verification token, create
-      # the confirumation URL for account activation.
-      #
-      # Otherwise the email has already been verified e.g. through
-      # a trusted openID provider and the account is active and a
-      # confirmation URL is not needed.
-      if token
-        @url = url_for(:host => SERVER_URL,
-                       :controller => "user", :action => "confirm",
-                       :display_name => user.display_name,
-                       :confirm_string => token.token)
-      end
+      @url = url_for(:host => SERVER_URL,
+                     :controller => "user", :action => "confirm",
+                     :display_name => user.display_name,
+                     :confirm_string => token.token)
 
       mail :to => user.email,
            :subject => I18n.t('notifier.signup_confirm.subject')
index 0c154c968e1f94fa80baf4cbbae7f0a1b70f3b2c..814deee9171220d93896643b05484d1bb9133076 100644 (file)
@@ -2,23 +2,8 @@
 
 <p><%= t("notifier.signup_confirm.created", :site_url => SERVER_URL) %></p>
 
-<% if @url -%>
 <p><%= t("notifier.signup_confirm.confirm") %></p>
 
 <p><%= link_to @url, @url %></p>
-<% end -%>
 
 <p><%= t("notifier.signup_confirm.welcome") %></p>
-
-<p><%= raw(t("notifier.signup_confirm_html.introductory_video", :introductory_video_link => link_to(t('notifier.signup_confirm_html.video_to_openstreetmap'), "http://showmedo.com/videos/video?name=1800000&fromSeriesID=180"))) %>
-   <%= raw(t("notifier.signup_confirm_html.more_videos", :more_videos_link => link_to(t('notifier.signup_confirm_html.more_videos_here'), "http://showmedo.com/videos/series?name=mS2P1ZqS6"))) %></p>
-
-<p><%= raw(t("notifier.signup_confirm_html.get_reading")) %></p>
-
-<p><%= raw(t("notifier.signup_confirm_html.ask_questions")) %></p>
-
-<p><%= raw(t("notifier.signup_confirm_html.wiki_signup")) %></p>
-
-<p><%= raw(t("notifier.signup_confirm_html.user_wiki_page")) %></p> 
-
-<p><%= raw(t("notifier.signup_confirm_html.current_user")) %></p>
index e52396462ee96825c290358c4a614b01911ea710..aee44782d3e7f79b8bd5693f7bd38cb4e7ddcff7 100644 (file)
@@ -2,41 +2,8 @@
 
 <%= fp(t("notifier.signup_confirm.created", :site_url => SERVER_URL)) %>
 
-<% if @url -%>
 <%= fp(t("notifier.signup_confirm.confirm")) %>
 
   <%= @url %>
 
-<% end -%>
 <%= fp(t("notifier.signup_confirm.welcome")) %>
-
-<%= fp(t("notifier.signup_confirm_plain.introductory_video")) %>
-
-  http://showmedo.com/videos/video?name=1800000&fromSeriesID=180       
-
-<%= fp(t("notifier.signup_confirm_plain.more_videos")) %>
-
-  http://showmedo.com/videos/series?name=mS2P1ZqS6     
-
-<%= fp(t("notifier.signup_confirm_plain.the_wiki")) %>
-
-  <%= t("notifier.signup_confirm_plain.the_wiki_url") %>
-
-<%= fp(t("notifier.signup_confirm_plain.blog_and_twitter")) %>
-
-  http://blog.openstreetmap.org/
-  http://twitter.com/openstreetmap
-
-<%= fp(t("notifier.signup_confirm_plain.ask_questions")) %>
-
-  http://help.openstreetmap.org/
-
-<%= fp(t("notifier.signup_confirm_plain.wiki_signup")) %>
-
-  <%= t("notifier.signup_confirm_plain.wiki_signup_url") %>
-
-<%= fp(t("notifier.signup_confirm_plain.user_wiki_page")) %>
-
-<%= fp(t("notifier.signup_confirm_plain.current_user")) %>
-
-  http://wiki.openstreetmap.org/wiki/Category:Users_by_geographical_region
index f3397411a7fd45d5c9807a1e6c452caa77ed12bb..f1fda060303c5faefe37c0dbf74ec7f86026aad9 100644 (file)
@@ -1262,28 +1262,7 @@ en:
       greeting: "Hi there!"
       created: "Someone (hopefully you) just created an account at %{site_url}."
       confirm: "Before we do anything else, we need to confirm that this request came from you, so if it did then please click the link below to confirm your account:"
-      welcome: "We would like to welcome you and provide you with some additional information to get you started."
-    signup_confirm_plain:
-      introductory_video: "You can watch an introductory video to OpenStreetMap here:"
-      more_videos: "There are more videos here:"
-      the_wiki: "Get reading about OpenStreetMap on the wiki:"
-      the_wiki_url: "http://wiki.openstreetmap.org/wiki/Beginners%27_guide"
-      blog_and_twitter: "Catch up with the latest news via the OpenStreetMap blog or Twitter:"
-      ask_questions: "You can ask any questions you may have about OpenStreetMap at our question and answer site:"
-      wiki_signup: "You may also want to sign up to the OpenStreetMap wiki at:"
-      wiki_signup_url: "http://wiki.openstreetmap.org/index.php?title=Special:Userlogin&type=signup&returnto=Main_Page"
-      user_wiki_page: "It is recommended that you create a user wiki page, which includes category tags noting where you are, such as [[Category:Users_in_London]]."
-      current_user: "A list of current users in categories, based on where in the world they are, is available from:"
-    signup_confirm_html:
-      introductory_video: "You can watch an %{introductory_video_link}."
-      video_to_openstreetmap: "introductory video to OpenStreetMap"
-      more_videos: "There are %{more_videos_link}."
-      more_videos_here: "more videos here"
-      get_reading: Get reading about OpenStreetMap <a href="http://wiki.openstreetmap.org/wiki/Beginners%27_guide">on the wiki</a>, and catch up with the latest news via the <a href="http://blog.openstreetmap.org/">OpenStreetMap blog</a> or <a href="http://twitter.com/openstreetmap">Twitter</a>.
-      ask_questions: You can ask any questions you may have about OpenStreetMap at our <a href="http://help.openstreetmap.org/">question and answer site</a>.
-      wiki_signup: 'You may also want to <a href="http://wiki.openstreetmap.org/index.php?title=Special:Userlogin&type=signup&returnto=Main_Page">sign up to the OpenStreetMap wiki</a>.'
-      user_wiki_page: 'It is recommended that you create a user wiki page, which includes category tags noting where you are, such as <a href="http://wiki.openstreetmap.org/wiki/Category:Users_in_London">[[Category:Users_in_London]]</a>.'
-      current_user: 'A list of current users in categories, based on where in the world they are, is available from <a href="http://wiki.openstreetmap.org/wiki/Category:Users_by_geographical_region">Category:Users_by_geographical_region</a>.'
+      welcome: "After you confirm your account, we'll provide you with some additional information to get you started."
     email_confirm:
       subject: "[OpenStreetMap] Confirm your email address"
     email_confirm_plain:
index cf0bfd3244ec47d2f55f23d6bd3b288f3bc82577..a53c70af92bb5f50aee4f58d05539721e3301fa9 100644 (file)
@@ -125,7 +125,7 @@ OpenStreetMap::Application.routes.draw do
   match '/edit' => 'site#edit', :via => :get
   match '/copyright/:copyright_locale' => 'site#copyright', :via => :get
   match '/copyright' => 'site#copyright', :via => :get
-  match '/welcome' => 'site#welcome', :via => :get
+  match '/welcome' => 'site#welcome', :via => :get, :as => :welcome
   match '/history' => 'changeset#list', :via => :get
   match '/history/feed' => 'changeset#feed', :via => :get, :format => :atom
   match '/export' => 'site#index', :export => true, :via => :get
index c565afd1ed132961f2ae4f49175b3995f7c0d275..f595ee73d1dc22cf371432afa721f85b6c9206ca 100644 (file)
@@ -140,10 +140,8 @@ class UserCreationTest < ActionController::IntegrationTest
     post 'user/confirm', { :confirm_string => confirm_string, :confirm_action => 'submit' }
     assert_response :redirect # to trace/mine in original referrer
     follow_redirect!
-    assert_response :redirect # but it not redirects to /user/<display_name>/traces
-    follow_redirect!
     assert_response :success
-    assert_template 'trace/list'
+    assert_template 'site/welcome'
   end
 
   def test_user_create_openid_success
@@ -235,9 +233,7 @@ class UserCreationTest < ActionController::IntegrationTest
     post 'user/confirm', { :confirm_string => confirm_string, :confirm_action => 'submit' }
     assert_response :redirect # to trace/mine in original referrer
     follow_redirect!
-    assert_response :redirect # but it not redirects to /user/<display_name>/traces
-    follow_redirect!
     assert_response :success
-    assert_template "trace/list"
+    assert_template 'site/welcome'
   end
 end