-
Notifications
You must be signed in to change notification settings - Fork 166
LG-13054: Remove automatic account creation for forgot password missing user #10434
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
Merged
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
9e24a6e
LG-13054: Remove account creation from password reset
aduth e1d7e4a
Always deliver_now for AnonymousMailer
aduth d89a0c1
Fix typo asynchronously
aduth 1874b39
Add spec AnonymousMailerPreview
aduth 9449c89
Fix the other "asynchronously" typo
aduth File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,54 @@ | ||
| # frozen_string_literal: true | ||
|
|
||
| # AnonymousMailer handles all email sending not associated with a user. It expects to be called | ||
| # using `with` that receives an `email` string value. | ||
| # | ||
| # You MUST deliver these messages using `deliver_now`. Anonymous messages rely on a plaintext email | ||
| # address, which is personally-identifiable information (PII). All method arguments are stored in | ||
| # the database when the email is being sent asynchronously by ActiveJob and we must not put PII in | ||
| # the database in plaintext. | ||
| # | ||
| # Example: | ||
| # | ||
| # AnonymousMailer.with(email:).password_reset_missing_user(request_id:).deliver_now | ||
| # | ||
| class AnonymousMailer < ActionMailer::Base | ||
| include Mailable | ||
| include LocaleHelper | ||
|
|
||
| before_action :attach_images | ||
|
|
||
| after_action :add_metadata | ||
|
|
||
| default( | ||
| from: email_with_name( | ||
| IdentityConfig.store.email_from, | ||
| IdentityConfig.store.email_from_display_name, | ||
| ), | ||
| reply_to: email_with_name( | ||
| IdentityConfig.store.email_from, | ||
| IdentityConfig.store.email_from_display_name, | ||
| ), | ||
| ) | ||
|
|
||
| layout 'mailer' | ||
|
|
||
| def password_reset_missing_user(request_id:) | ||
| @request_id = request_id | ||
|
|
||
| mail( | ||
| to: email, | ||
| subject: t('anonymous_mailer.password_reset_missing_user.subject'), | ||
| ) | ||
| end | ||
|
|
||
| private | ||
|
|
||
| def email | ||
| params.fetch(:email) | ||
| end | ||
|
|
||
| def add_metadata | ||
| message.instance_variable_set(:@_metadata, action: action_name) | ||
| end | ||
| end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
42 changes: 42 additions & 0 deletions
42
app/views/anonymous_mailer/password_reset_missing_user.html.erb
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,42 @@ | ||
| <p class="lead" style="margin-bottom: 1em"> | ||
| <%= t('anonymous_mailer.password_reset_missing_user.info_no_account', app_name: APP_NAME) %> | ||
| </p> | ||
| <p class="lead"> | ||
| <%= t('anonymous_mailer.password_reset_missing_user.info_request_different', app_name: APP_NAME) %> | ||
| </p> | ||
|
|
||
| <table class="button expanded large radius"> | ||
| <tbody> | ||
| <tr> | ||
| <td> | ||
| <table style="margin-bottom: 1em"> | ||
| <tbody> | ||
| <tr> | ||
| <td style="text-align: center"> | ||
| <%= link_to t('anonymous_mailer.password_reset_missing_user.try_different_email'), | ||
| new_user_password_url(request_id: @request_id), | ||
| target: '_blank', | ||
| class: 'float-center', | ||
| align: 'center', | ||
| rel: 'noopener' %> | ||
| </td> | ||
| </tr> | ||
| </tbody> | ||
| </table> | ||
| </td> | ||
| <td class="expander"></td> | ||
| </tr> | ||
| </tbody> | ||
| </table> | ||
|
|
||
| <p> | ||
| <%= t( | ||
| 'anonymous_mailer.password_reset_missing_user.use_this_email_html', | ||
| create_account_link_html: link_to( | ||
| t('anonymous_mailer.password_reset_missing_user.create_new_account'), | ||
| sign_up_register_url(request_id: @request_id), | ||
| target: '_blank', | ||
| rel: 'noopener', | ||
| ), | ||
| ) %> | ||
| </p> |
File renamed without changes.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.