diff --git a/app.rb b/app.rb index eb5060f5..7e4ec522 100644 --- a/app.rb +++ b/app.rb @@ -375,9 +375,8 @@ post '/send_password_reset' do site = Site[email: params[:email]] if site - site.update password_reset_token: token - token = SecureRandom.uuid.gsub('-', '') + site.update password_reset_token: token body = <<-EOT Hello! This is the NeoCities cat, and I have received a password reset request for your e-mail address. Purrrr. @@ -393,6 +392,7 @@ the NeoCities Cat body.strip! EmailWorker.perform_async({ + from: 'web@neocities.org', to: params[:email], subject: '[NeoCities] Password Reset', body: body diff --git a/workers/email_worker.rb b/workers/email_worker.rb index a215349c..a28f1a01 100644 --- a/workers/email_worker.rb +++ b/workers/email_worker.rb @@ -1,8 +1,10 @@ class EmailWorker include Sidekiq::Worker + sidekiq_options queue: :emails, retry: 10, backtrace: true def perform(args={}) Mail.deliver do + from args[:from] to args[:to] subject args[:subject] body args[:body]