-
Notifications
You must be signed in to change notification settings - Fork 186
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
Bring registration emails in line with v2 statuses #10720
Open
dunkOnIT
wants to merge
9
commits into
thewca:main
Choose a base branch
from
dunkOnIT:reg-fix/register-email-when-pending
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
f47d40a
fixed email that gets sent when reactivating reg
dunkOnIT ddd35d5
no idea
dunkOnIT 573b7ff
rubocop
dunkOnIT 1754bde
removed perform deliveries line
dunkOnIT c4e475c
fixed test failures
dunkOnIT 9eb75dd
added mailer tests
dunkOnIT 8335d9a
fixed failing link and removed reference to non-existent i18n key
dunkOnIT 00d9281
perform enqueued jobs changes
dunkOnIT 9b68894
added waitlisted email locale tests
dunkOnIT 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 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 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
20 changes: 0 additions & 20 deletions
20
app/views/registrations_mailer/notify_registrant_of_pending_registration.html.erb
This file was deleted.
Oops, something went wrong.
11 changes: 11 additions & 0 deletions
11
app/views/registrations_mailer/notify_registrant_of_waitlisted_registration.html.erb
This file contains 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,11 @@ | ||
<% @competition = @registration.competition %> | ||
|
||
<p> | ||
<%= t 'registrations.mailer.waiting_list.waitlisted_html', here: link_to(t('common.here'), competition_register_url(@competition)) %> | ||
</p> | ||
|
||
<p> | ||
<%= t 'registrations.mailer.waiting_list.email_if_error' %> | ||
</p> | ||
|
||
<%= render partial: 'organizers_or_delegates_signature' %> |
This file contains 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 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 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 |
---|---|---|
|
@@ -15,7 +15,7 @@ | |
let(:registration) { FactoryBot.create(:registration, user: french_user, competition: competition_with_organizers) } | ||
let(:mail_new) { RegistrationsMailer.notify_registrant_of_new_registration(registration) } | ||
let(:mail_accepted) { RegistrationsMailer.notify_registrant_of_accepted_registration(registration) } | ||
let(:mail_pending) { RegistrationsMailer.notify_registrant_of_pending_registration(registration) } | ||
let(:mail_waitlisted) { RegistrationsMailer.notify_registrant_of_waitlisted_registration(registration) } | ||
let(:mail_deleted) { RegistrationsMailer.notify_registrant_of_deleted_registration(registration) } | ||
|
||
it "renders the headers in foreign locale" do | ||
|
@@ -26,7 +26,7 @@ | |
# scope this call, but rather compare the result to the expected locale. | ||
expect(mail_new.subject).to eq(I18n.t('registrations.mailer.new.mail_subject', comp_name: registration.competition.name, locale: :fr)) | ||
expect(mail_accepted.subject).to eq(I18n.t('registrations.mailer.accepted.mail_subject', comp_name: registration.competition.name, locale: :fr)) | ||
expect(mail_pending.subject).to eq(I18n.t('registrations.mailer.pending.mail_subject', comp_name: registration.competition.name, locale: :fr)) | ||
expect(mail_waitlisted.subject).to eq(I18n.t('registrations.mailer.waitlisted.mail_subject', comp_name: registration.competition.name, locale: :fr)) | ||
expect(mail_deleted.subject).to eq(I18n.t('registrations.mailer.deleted.mail_subject', comp_name: registration.competition.name, locale: :fr)) | ||
end | ||
|
||
|
@@ -41,7 +41,7 @@ | |
end | ||
expect(mail_new.body.encoded).to match(regards_in_french) | ||
expect(mail_accepted.body.encoded).to match(regards_in_french) | ||
expect(mail_pending.body.encoded).to match(regards_in_french) | ||
expect(mail_waitlisted.body.encoded).to match(regards_in_french) | ||
expect(mail_deleted.body.encoded).to match(regards_in_french) | ||
end | ||
end | ||
|
@@ -169,26 +169,24 @@ | |
end | ||
end | ||
|
||
describe "notify_registrant_of_pending_registration for a competition without organizers" do | ||
let(:mail) { RegistrationsMailer.notify_registrant_of_pending_registration(registration) } | ||
describe "notify_registrant_of_waitlisted_registration for competition without organizers" do | ||
let(:mail) { RegistrationsMailer.notify_registrant_of_waitlisted_registration(registration) } | ||
let(:registration) { FactoryBot.create(:registration, competition: competition_without_organizers) } | ||
|
||
it "renders the headers" do | ||
expect(mail.subject).to eq("Registration Moved to Waitlist: #{competition_without_organizers.name}") | ||
expect(mail.subject).to eq("You're on the Waiting List: #{competition_without_organizers.name}") | ||
expect(mail.to).to eq([registration.email]) | ||
expect(mail.reply_to).to eq(competition_without_organizers.delegates.map(&:email)) | ||
expect(mail.from).to eq(["[email protected]"]) | ||
end | ||
|
||
it "renders the body" do | ||
expect(mail.body.encoded).to match("Your registration for .{1,200}#{registration.competition.name}.{1,200} has been moved to the waiting list") | ||
expect(mail.body.encoded).to match("If you think this is an error, please reply to this email.") | ||
expect(mail.body.encoded).to match("Regards, #{users_to_sentence(competition_without_organizers.organizers_or_delegates)}.") | ||
expect(mail.body.encoded).to match("The competition is full, but you have been placed on a waiting list, and you will receive an email if enough spots open up for you to be able to attend.") | ||
end | ||
end | ||
|
||
describe "notify_registrant_of_pending_registration for a competition with organizers" do | ||
let(:mail) { RegistrationsMailer.notify_registrant_of_pending_registration(registration) } | ||
describe "notify_registrant_of_waitlisted_registration for competition with organizers" do | ||
let(:mail) { RegistrationsMailer.notify_registrant_of_waitlisted_registration(registration) } | ||
let(:registration) { FactoryBot.create(:registration, competition: competition_with_organizers) } | ||
|
||
it "sets organizers in the reply_to" do | ||
|
This file contains 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
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.
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.
Why is this disappearing without replacement? There is
notify_registrant_of_waitlisted_registration
now, which you could well put here.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.
The header test seems to rely on a french translation key which we don't have - should I add it in in order for the test to pass? I can find some french people to consult with
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.
Nah, just a comment that we should add this as soon as French is translated should suffice
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.
On the other hand, French does get updated rather infrequently.
If you do indeed have contacts to French speakers (ideally, cubers) it would be great if you could add the relevant snippets.