From 4cd2f1d9c165807ce83dd79684380885baaf7756 Mon Sep 17 00:00:00 2001 From: sjain1107 Date: Fri, 29 Apr 2016 23:39:28 +0530 Subject: [PATCH] Add inviter diaspora-ID to the invite email #6796 closes #6817 --- Changelog.md | 2 ++ app/controllers/invitations_controller.rb | 2 +- app/views/notifier/invite.markerb | 2 +- config/locales/diaspora/en.yml | 4 +++- 4 files changed, 7 insertions(+), 3 deletions(-) diff --git a/Changelog.md b/Changelog.md index 6ecc0ce22..1f4915fbe 100644 --- a/Changelog.md +++ b/Changelog.md @@ -8,6 +8,8 @@ ## Features +* The sender's diaspora-ID is now shown in invitation mails [#6817](https://github.com/diaspora/diaspora/pull/6817) + # 0.5.8.0 ## Refactor diff --git a/app/controllers/invitations_controller.rb b/app/controllers/invitations_controller.rb index 1801c39fe..6acf3602d 100644 --- a/app/controllers/invitations_controller.rb +++ b/app/controllers/invitations_controller.rb @@ -39,7 +39,7 @@ class InvitationsController < ApplicationController else params[:invitation_code] end - + @inviter = user || InvitationCode.where(id: params[:invitation_code]).first.try(:user) if @invitation_code.present? render 'notifier/invite', :layout => false else diff --git a/app/views/notifier/invite.markerb b/app/views/notifier/invite.markerb index f5222067b..1e00c6c0a 100644 --- a/app/views/notifier/invite.markerb +++ b/app/views/notifier/invite.markerb @@ -1 +1 @@ -<%= t('.message', :invite_url => invite_code_url(@invitation_code), :diasporafoundation_url => 'https://diasporafoundation.org/') %> +<%= t('.message', :invite_url => invite_code_url(@invitation_code), :diasporafoundation_url => 'https://diasporafoundation.org/', :diaspora_id => @inviter.try(:diaspora_handle)) %> diff --git a/config/locales/diaspora/en.yml b/config/locales/diaspora/en.yml index a74e956fb..36354accd 100644 --- a/config/locales/diaspora/en.yml +++ b/config/locales/diaspora/en.yml @@ -838,12 +838,14 @@ en: message: |- Hello! - You have been invited to join diaspora*! + You have been invited to join diaspora* by %{diaspora_id}! Click this link to get started [%{invite_url}][1] + Or you can add %{diaspora_id} to your contacts if you already have an account. + Love,