mirror of
https://github.com/neocities/neocities.git
synced 2025-08-21 00:24:29 +02:00
use noreply for emails, changing support email to reduce spam, less email notifications
This commit is contained in:
parent
3237ee6809
commit
5d56e12561
11 changed files with 16 additions and 44 deletions
10
app.rb
10
app.rb
|
@ -125,16 +125,6 @@ not_found do
|
|||
end
|
||||
|
||||
error do
|
||||
=begin
|
||||
EmailWorker.perform_async({
|
||||
from: 'web@neocities.org',
|
||||
to: 'errors@neocities.org',
|
||||
subject: "[Neocities Error] #{env['sinatra.error'].class}: #{env['sinatra.error'].message}",
|
||||
body: erb(:'templates/email/error', layout: false),
|
||||
no_footer: true
|
||||
})
|
||||
=end
|
||||
|
||||
if @api
|
||||
api_error 500, 'server_error', 'there has been an unknown server error, please try again later'
|
||||
end
|
||||
|
|
|
@ -194,7 +194,7 @@ post '/admin/email' do
|
|||
|
||||
queued_sites.each do |site|
|
||||
EmailWorker.perform_at((day.days.from_now + seconds), {
|
||||
from: 'Kyle from Neocities <kyle@neocities.org>',
|
||||
from: Site::FROM_EMAIL,
|
||||
to: site.email,
|
||||
subject: params[:subject],
|
||||
body: params[:body]
|
||||
|
|
|
@ -36,9 +36,9 @@ post '/contact' do
|
|||
end
|
||||
|
||||
EmailWorker.perform_async({
|
||||
from: 'web@neocities.org',
|
||||
from: Site::FROM_EMAIL,
|
||||
reply_to: params[:email],
|
||||
to: 'contact@neocities.org',
|
||||
to: $config['support_email'],
|
||||
subject: subject,
|
||||
body: body,
|
||||
no_footer: true
|
||||
|
|
|
@ -121,7 +121,7 @@ post '/create' do
|
|||
@site.phone_verification_required = true if self.class.production? && BlackBox.phone_verification_required?(@site)
|
||||
rescue => e
|
||||
EmailWorker.perform_async({
|
||||
from: 'web@neocities.org',
|
||||
from: Site::FROM_EMAIL,
|
||||
to: 'errors@neocities.org',
|
||||
subject: "[Neocities Error] Phone verification exception",
|
||||
body: "#{e.inspect}\n#{e.backtrace}",
|
||||
|
|
|
@ -24,7 +24,7 @@ post '/dmca/contact' do
|
|||
erb :'dmca'
|
||||
else
|
||||
EmailWorker.perform_async({
|
||||
from: 'web@neocities.org',
|
||||
from: Site::FROM_EMAIL,
|
||||
reply_to: params[:email],
|
||||
to: 'dmca@neocities.org',
|
||||
subject: "[Neocities DMCA Notice]: #{params[:subject]}",
|
||||
|
|
|
@ -169,7 +169,7 @@ the Neocities Cat
|
|||
body.strip!
|
||||
|
||||
EmailWorker.perform_async({
|
||||
from: 'web@neocities.org',
|
||||
from: Site::FROM_EMAIL,
|
||||
to: params[:email],
|
||||
subject: '[Neocities] Username lookup',
|
||||
body: body
|
||||
|
|
|
@ -1,12 +1,4 @@
|
|||
post '/webhooks/paypal' do
|
||||
EmailWorker.perform_async({
|
||||
from: 'web@neocities.org',
|
||||
to: 'errors@neocities.org',
|
||||
subject: "[Neocities Paypal Webhook] Received a Webhook from Paypal",
|
||||
body: params.inspect,
|
||||
no_footer: true
|
||||
})
|
||||
|
||||
'ok'
|
||||
end
|
||||
|
||||
|
@ -57,7 +49,7 @@ post '/webhooks/paypal/tipping_notify' do
|
|||
)
|
||||
|
||||
EmailWorker.perform_async({
|
||||
from: 'web@neocities.org',
|
||||
from: Site::FROM_EMAIL,
|
||||
to: params[:payer_email],
|
||||
subject: "You sent a #{@tip.amount_string} tip!",
|
||||
body: Tilt.new('./views/templates/email/tip_sent.erb', pretty: true).render(self)
|
||||
|
@ -66,24 +58,12 @@ end
|
|||
|
||||
post '/webhooks/stripe' do
|
||||
event = JSON.parse request.body.read
|
||||
if event['type'] == 'customer.created'
|
||||
username = event['data']['object']['description'].split(' - ').first
|
||||
email = event['data']['object']['email']
|
||||
|
||||
EmailWorker.perform_async({
|
||||
from: 'web@neocities.org',
|
||||
to: 'contact@neocities.org',
|
||||
subject: "[Neocities] New customer: #{username}",
|
||||
body: "#{username}\n#{email}\n#{Site[username: username].uri}",
|
||||
no_footer: true
|
||||
})
|
||||
end
|
||||
|
||||
if event['type'] == 'charge.failed'
|
||||
site = stripe_get_site_from_event event
|
||||
|
||||
EmailWorker.perform_async({
|
||||
from: 'web@neocities.org',
|
||||
from: Site::FROM_EMAIL,
|
||||
to: site.email,
|
||||
subject: "[Neocities] There was an issue charging your card",
|
||||
body: Tilt.new('./views/templates/email/charge_failure.erb', pretty: true).render(self)
|
||||
|
@ -98,7 +78,7 @@ post '/webhooks/stripe' do
|
|||
site.save_changes validate: false
|
||||
|
||||
EmailWorker.perform_async({
|
||||
from: 'web@neocities.org',
|
||||
from: Site::FROM_EMAIL,
|
||||
to: site.email,
|
||||
subject: "[Neocities] Supporter plan has ended",
|
||||
body: Tilt.new('./views/templates/email/supporter_ended.erb', pretty: true).render(self)
|
||||
|
@ -112,7 +92,7 @@ post '/webhooks/stripe' do
|
|||
invoice_obj = event['data']['object']
|
||||
|
||||
EmailWorker.perform_async({
|
||||
from: 'web@neocities.org',
|
||||
from: Site::FROM_EMAIL,
|
||||
to: site.email,
|
||||
subject: "[Neocities] Invoice",
|
||||
body: Tilt.new('./views/templates/email/invoice.erb', pretty: true).render(
|
||||
|
@ -127,7 +107,6 @@ post '/webhooks/stripe' do
|
|||
end
|
||||
end
|
||||
|
||||
|
||||
'ok'
|
||||
end
|
||||
|
||||
|
|
|
@ -85,7 +85,7 @@ def send_confirmation_email(site=current_site)
|
|||
|
||||
EmailWorker.perform_async({
|
||||
from: 'web@neocities.org',
|
||||
reply_to: 'contact@neocities.org',
|
||||
reply_to: 'noreply@neocities.org',
|
||||
to: site.email,
|
||||
subject: "[Neocities] Confirm your email address",
|
||||
body: Tilt.new('./views/templates/email/confirm.erb', pretty: true).render(self, site: site)
|
||||
|
|
|
@ -29,3 +29,4 @@ minfraud_license_key: DERPDERPDERP
|
|||
google_custom_search_key: herpderp
|
||||
google_custom_search_cx: herpderp
|
||||
google_custom_search_query_limit: 69
|
||||
support_email: derp@example.com
|
|
@ -31,6 +31,7 @@ development:
|
|||
google_custom_search_key: herpderp
|
||||
google_custom_search_cx: herpderp
|
||||
google_custom_search_query_limit: 69
|
||||
support_email: derp@example.com
|
||||
test:
|
||||
database: 'postgres://localhost/neocities_test'
|
||||
database_pool: 1
|
||||
|
@ -68,3 +69,4 @@ test:
|
|||
google_custom_search_key: herpderp
|
||||
google_custom_search_cx: herpderp
|
||||
google_custom_search_query_limit: 69
|
||||
support_email: derp@example.com
|
|
@ -121,7 +121,7 @@ class Site < Sequel::Model
|
|||
IP_CREATE_LIMIT = 1000
|
||||
TOTAL_IP_CREATE_LIMIT = 10000
|
||||
|
||||
FROM_EMAIL = 'noreply@neocities.org'
|
||||
FROM_EMAIL = 'Neocities <noreply@neocities.org>'
|
||||
|
||||
PLAN_FEATURES = {}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue