-
Notifications
You must be signed in to change notification settings - Fork 130
[Contracts] Add stale contract human follow-up notification #14505
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
Open
mattsoh
wants to merge
15
commits into
hackclub:main
Choose a base branch
from
mattsoh:mattsoh-stale-application-onboarder-notification
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 12 commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
446b7ce
add copy and paste link to receipt email
mattsoh 5b53cdc
Merge branch 'main' into mattsoh-copy-paste-receipt-link
mattsoh 75f5e7d
fix lint
mattsoh 1a6d412
add email reminder to HCB ops when contract not completed
mattsoh 2a22439
Simplify receipt upload instructions
mattsoh 2278695
Update _attach_receipt.html.erb
mattsoh b2df6db
Update _attach_receipt.html.erb
mattsoh 2a18e39
add email html for update
mattsoh e4ae2fe
Merge branch 'main' into mattsoh-stale-application-onboarder-notifica…
mattsoh ef7f05b
Merge branch 'main' into mattsoh-stale-application-onboarder-notifica…
mattsoh ea6a65d
Merge branch 'mattsoh-stale-application-onboarder-notification' of ht…
mattsoh fac1bbb
Merge branch 'mattsoh-stale-application-onboarder-notification' of ht…
mattsoh db46379
Rename `OperationsUpdateJob` to `HumanFollowUpJob`
mattsoh 9b9c94d
moved follow up job from party to contract mailer
mattsoh 42020b0
Merge branch 'main' into mattsoh-stale-application-onboarder-notifica…
mattsoh 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,22 @@ | ||
| # frozen_string_literal: true | ||
|
|
||
| class Contract | ||
| # Nudges HCB's party when an agreement they're the point of contact for is | ||
| # still unsigned. Unlike Contract::Party::ReminderJob this doesn't care | ||
| # whether HCB is the one holding things up (or maybe they forgot to sign...). | ||
| class OperationsUpdateJob < ApplicationJob | ||
| queue_as :low | ||
| discard_on ActiveJob::DeserializationError | ||
|
|
||
| def perform(contract) | ||
| return unless contract.sent? | ||
|
|
||
| party = contract.party(:hcb) | ||
| return if party.nil? | ||
|
|
||
| Contract::PartyMailer.with(party:).operations_update.deliver_later | ||
| end | ||
|
|
||
| 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
20 changes: 20 additions & 0 deletions
20
app/tasks/maintenance/schedule_contract_operations_updates_task.rb
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,20 @@ | ||
| # frozen_string_literal: true | ||
|
|
||
| module Maintenance | ||
| class ScheduleContractOperationsUpdatesTask < MaintenanceTasks::Task | ||
| def collection | ||
| Contract::FiscalSponsorship.where(aasm_state: :sent) | ||
| end | ||
|
|
||
| def process(contract) | ||
| due_at = contract.created_at + Contract::FiscalSponsorship::OPERATIONS_UPDATE_AFTER | ||
|
|
||
| if due_at.future? | ||
| Contract::OperationsUpdateJob.set(wait_until: due_at).perform_later(contract) | ||
| else | ||
| Contract::OperationsUpdateJob.perform_later(contract) | ||
| end | ||
| end | ||
|
mattsoh marked this conversation as resolved.
|
||
|
|
||
| end | ||
| end | ||
46 changes: 46 additions & 0 deletions
46
app/views/contract/party_mailer/operations_update_hcb.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,46 @@ | ||
| <p>Hi there! 👋</p> | ||
|
|
||
| <p> | ||
| The <%= @contract.agreement_name %> for | ||
| <% if @contract.contractable.is_a?(Event::Application) %> | ||
| <%= link_to "#{@contract.event_name}'s application", submission_application_url(@contract.contractable) %> | ||
| <% elsif @contract.contractable.is_a?(OrganizerPositionInvite) %> | ||
| <%= link_to "an invitation to #{@contract.event_name}", organizer_position_invite_url(@contract.contractable) %> | ||
| <% else %> | ||
| <%= @contract.event_name %> | ||
| <% end %> | ||
| was sent <%= time_ago_in_words @contract.created_at %> ago and still hasn't been signed by everyone. | ||
| You're the HCB point of contact on it, so we wanted to give you an update. | ||
| </p> | ||
|
|
||
| <p>Still waiting on:</p> | ||
|
|
||
| <ul> | ||
| <% @contract.parties.reject(&:signed?).each do |pending_party| %> | ||
| <li> | ||
| <%= pending_party.hcb? ? "You (HCB Operations)" : pending_party.role.humanize %> — | ||
| <%= pending_party.email %> | ||
| </li> | ||
| <% end %> | ||
| </ul> | ||
|
|
||
| <% if @party.pending? %> | ||
| <p> | ||
| <%= link_to "Click here", contract_party_url(@party) %> to sign your part of the agreement. | ||
| </p> | ||
| <% end %> | ||
|
|
||
| <% if @contract.external_id.present? %> | ||
| <p> | ||
| <%= link_to "View the submission on DocuSeal", @contract.docuseal_submission_url %> to see where it's stuck. | ||
| </p> | ||
| <% end %> | ||
|
|
||
| <p> | ||
| If this agreement is no longer needed, you can void it so it stops chasing everyone for signatures. | ||
| </p> | ||
|
|
||
| <p> | ||
| Thanks!<br> | ||
| Here's a cookie 🍪 | ||
| </p> |
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.
I would actually separate this from the concept of a contract party. I would have this live in the contract itself. This is because contract parties are intended to be generic and work for all types of parties, including the organizer, co-signer, and HCB operations. Instead, what we're looking for here is stale contracts, and I would say that it's more of a contract-level concept rather than per party. My recommendation is that you move this to the contract mailer.