mirror of
https://github.com/neocities/neocities.git
synced 2025-04-25 01:32:36 +02:00
better contact info
This commit is contained in:
parent
1ffcfb8487
commit
55a245c290
1 changed files with 17 additions and 2 deletions
|
@ -16,12 +16,27 @@ post '/contact' do
|
||||||
if !@errors.empty?
|
if !@errors.empty?
|
||||||
erb :'contact'
|
erb :'contact'
|
||||||
else
|
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({
|
EmailWorker.perform_async({
|
||||||
from: 'web@neocities.org',
|
from: 'web@neocities.org',
|
||||||
reply_to: params[:email],
|
reply_to: params[:email],
|
||||||
to: 'contact@neocities.org',
|
to: 'contact@neocities.org',
|
||||||
subject: "[Neocities Contact]: #{params[:subject]}",
|
subject: subject,
|
||||||
body: params[:body],
|
body: body,
|
||||||
no_footer: true
|
no_footer: true
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue