-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add valid_email check to mailer #312
Comments
@Tooyosi The main goal here will be to get the various mailers to reflect on the user's But it'll basically look like this (I happened to have already started this): # frozen_string_literal: true
class AddValidEmailToUsers < ActiveRecord::Migration
def up
execute <<-SQL
ALTER FOREIGN TABLE users ADD COLUMN valid_email boolean DEFAULT true;
SQL
end
def down
execute <<-SQL
ALTER FOREIGN TABLE users DROP COLUMN IF EXISTS valid_email;
SQL
end
end There's no data to update here since this just grants access to the existing column across the way at Panoptes' user table. You'll want to add it to the factory and a couple other places too, use the above PR as a reference. So once that user attribute is available to check, you'll want to find the places that needs doing. I'm pretty sure the NotificationEmailWorker and DigestEmailWorker are the ones you want. It looks like some checks are already being done for notifications: https://github.com/zooniverse/talk-api/blob/master/app/workers/notification_email_worker.rb#L24 A return out of the worker's perform method prior to the email getting sent would work for this, too. Return if the user's let me know when you have questions! |
Closed by #316 |
Current Behavior: Talk sends notification digests to users with invalid email addresses. When these emails bounce, the email_verify app will update the valid_email property on the Panoptes user table, but the Talk mailer does not reflect on or respect this property.
Desired Behavior: Talk checks a user's valid_email property before sending notification emails.
Possible Solution: Add valid_email as part of the foreign data wrapper for the shared Users table, add a check to the mailer / email worker to only send email to users where valid_email is true.
The text was updated successfully, but these errors were encountered: