From 55a245c290cbb13086c79aa4c7e2407e26aafbe9 Mon Sep 17 00:00:00 2001 From: Kyle Drake Date: Tue, 18 Oct 2016 15:31:39 -0500 Subject: [PATCH] better contact info --- app/contact.rb | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/app/contact.rb b/app/contact.rb index 74bb591e..f6563d19 100644 --- a/app/contact.rb +++ b/app/contact.rb @@ -16,12 +16,27 @@ post '/contact' do if !@errors.empty? erb :'contact' else + body = params[:body] + + if current_site + body = "current username: #{current_site.username}\n\n" + body + if parent_site != current_site + body = "parent username: #{parent_site.username}\n\n" + body + end + end + + if current_site.supporter? + subject = "[Neocities Supporter Contact]: #{params[:subject]}" + else + subject = "[Neocities Contact]: #{params[:subject]}" + end + EmailWorker.perform_async({ from: 'web@neocities.org', reply_to: params[:email], to: 'contact@neocities.org', - subject: "[Neocities Contact]: #{params[:subject]}", - body: params[:body], + subject: subject, + body: body, no_footer: true })