-
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
Send letters to contacts with no email address #884
Conversation
end | ||
|
||
def find_email_variations(email_type) | ||
WasteExemptionsEngine::Registration.where("#{email_type} ~* ? or #{email_type} ~* ? or #{email_type} ~* ?", WASTE_EXEMPTIONS_EMAIL_VARIATIONS, EXEMPTION_EMAIL_VARIATIONS, NCCC_EMAIL_VARIATIONS) |
Check notice
Code scanning / Brakeman
Possible SQL injection.
# rubocop:disable Layout/LineLength | ||
class RemoveNcccEmailService < ::WasteExemptionsEngine::BaseService | ||
|
||
# https://rubular.com/r/LPHA79nxD5k2ff |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is really handy. (Make sure it is cleared on rubular.com once this is merged!)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
... in which case the comment should be deleted ....
@@ -18,7 +16,7 @@ class Registration < ::WasteExemptionsEngine::ApplicationRecord | |||
|
|||
scope :renewals, -> { where.not(referring_registration_id: nil) } | |||
|
|||
scope :contact_email_is_not_nccc, -> { where.not(contact_email: NCCC_EMAIL) } | |||
scope :contact_email_is_not_blank, -> { where.not(contact_email: nil) } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"blank" and "nil" are not the same - maybe rename this to contact_email_present
and also check for empty string values?
@@ -24,7 +24,7 @@ def ad_expiring_registrations | |||
@_ad_expiring_registrations ||= lambda do | |||
WasteExemptionsEngine::Registration | |||
.order(:reference) | |||
.where(contact_email: WasteExemptionsEngine.configuration.assisted_digital_email) | |||
.where(contact_email: nil) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Might need to also check for empty strings
https://eaflood.atlassian.net/browse/RUBY-1997
Here we have the changes to allow letters to be sent to registrations without an email address.
In WEX there are two emails address captured, applicant_email and contact_email.
These changes mean letters are sent to any emails that are nil value instead of the NCCC email address.