mirror of
https://github.com/neocities/neocities.git
synced 2025-07-21 10:06:00 +02:00
brush up email requirements
This commit is contained in:
parent
933fb9fcfd
commit
d3fc35989d
10 changed files with 149 additions and 10 deletions
47
app.rb
47
app.rb
|
@ -407,11 +407,46 @@ post '/create' do
|
|||
plan: params[:selected_plan]
|
||||
)
|
||||
@site.stripe_customer_id = customer.id
|
||||
|
||||
plan_name = customer.subscriptions.first['plan']['name']
|
||||
|
||||
EmailWorker.perform_async({
|
||||
from: 'web@neocities.org',
|
||||
reply_to: 'contact@neocities.org',
|
||||
to: @site.email,
|
||||
subject: "[Neocities] You've become a supporter!",
|
||||
body: Tilt.new('./views/templates/email_subscription.erb', pretty: true).render(self, plan_name: plan_name)
|
||||
})
|
||||
|
||||
end
|
||||
|
||||
@site.save
|
||||
end
|
||||
|
||||
EmailWorker.perform_async({
|
||||
from: 'web@neocities.org',
|
||||
reply_to: 'contact@neocities.org',
|
||||
to: @site.email,
|
||||
subject: "[Neocities] Welcome to Neocities!",
|
||||
body: Tilt.new('./views/templates/email_welcome.erb', pretty: true).render(self)
|
||||
})
|
||||
|
||||
EmailWorker.perform_async({
|
||||
from: 'web@neocities.org',
|
||||
reply_to: 'contact@neocities.org',
|
||||
to: @site.email,
|
||||
subject: "[Neocities] Welcome to Neocities!",
|
||||
body: Tilt.new('./views/templates/email_welcome.erb', pretty: true).render(self)
|
||||
})
|
||||
|
||||
EmailWorker.perform_async({
|
||||
from: 'web@neocities.org',
|
||||
reply_to: 'contact@neocities.org',
|
||||
to: @site.email,
|
||||
subject: "[Neocities] Confirm your email address",
|
||||
body: Tilt.new('./views/templates/email_confirm.erb', pretty: true).render(self)
|
||||
})
|
||||
|
||||
session[:id] = @site.id
|
||||
redirect '/'
|
||||
else
|
||||
|
@ -1041,6 +1076,18 @@ post '/comment/:comment_id/delete' do |comment_id|
|
|||
return {result: 'error'}.to_json
|
||||
end
|
||||
|
||||
get '/site/:username/confirm_email/:token' do
|
||||
site = Site[username: params[:username]]
|
||||
if site.email_confirmation_token == params[:token]
|
||||
site.email_confirmed = true
|
||||
site.save
|
||||
|
||||
erb :'site_email_confirmed'
|
||||
else
|
||||
erb :'site_email_not_confirmed'
|
||||
end
|
||||
end
|
||||
|
||||
post '/site/:username/report' do |username|
|
||||
site = Site[username: username]
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue