- 
                Notifications
    
You must be signed in to change notification settings  - Fork 6
 
Add organizer summary emails #194
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
      
      
            sampoder
  wants to merge
  38
  commits into
  main
  
    
      
        
          
  
    
      Choose a base branch
      
     
    
      
        
      
      
        
          
          
        
        
          
            
              
              
              
  
           
        
        
          
            
              
              
           
        
       
     
  
        
          
            
          
            
          
        
       
    
      
from
organizer-summary
  
      
      
   
  
    
  
  
  
 
  
      
    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 21 commits
      Commits
    
    
            Show all changes
          
          
            38 commits
          
        
        Select commit
          Hold shift + click to select a range
      
      07ea523
              
                Update digest_mailer.rb
              
              
                sampoder 3ac0e14
              
                Create organizer-summary.html.erb
              
              
                sampoder 7e08a8c
              
                Rename organizer-summary.html.erb to organizer_summary.html.erb
              
              
                sampoder 325a72e
              
                Update digest_mailer.rb
              
              
                sampoder b399e35
              
                Update organizer_summary.html.erb
              
              
                sampoder 2d5d748
              
                Update digest_mailer.rb
              
              
                sampoder 5e4c9f0
              
                Update organizer_summary.html.erb
              
              
                sampoder 28474c9
              
                Update digest_mailer.rb
              
              
                sampoder 994b8e6
              
                Update digest_mailer.rb
              
              
                sampoder e1e15bf
              
                Update digest_mailer.rb
              
              
                sampoder 19f3094
              
                Update app/mailers/hackathons/digest_mailer.rb
              
              
                sampoder a23ec86
              
                Update app/views/hackathons/digest_mailer/organizer_summary.html.erb
              
              
                sampoder c8bf0d4
              
                Create organizer_summary.text.erb
              
              
                sampoder 4c25f3a
              
                Restructure Post-Review
              
              
                sampoder 7e803ac
              
                Standard
              
              
                sampoder c633124
              
                Update send_organizer_summaries_job.rb
              
              
                sampoder f08d496
              
                Merge branch 'main' into organizer-summary
              
              
                sampoder 8c594d4
              
                Update send_organizer_summaries_job.rb
              
              
                sampoder 1f94a11
              
                Merge branch 'main' into organizer-summary
              
              
                sampoder af8f7ed
              
                Merge branch 'main' into organizer-summary
              
              
                sampoder 728b784
              
                Update send_organizer_summaries_job.rb
              
              
                sampoder 31243bc
              
                Update app/mailers/hackathons/digest_mailer.rb
              
              
                sampoder 331ec67
              
                Update app/views/hackathons/digest_mailer/organizer_summary.html.erb
              
              
                sampoder 1b98f29
              
                Update app/views/hackathons/digest_mailer/organizer_summary.text.erb
              
              
                sampoder 22c52e1
              
                Update app/mailers/hackathons/digest_mailer.rb
              
              
                sampoder cf5b9a2
              
                Update app/jobs/hackathons/send_organizer_summaries_job.rb
              
              
                sampoder 115a937
              
                Update app/jobs/hackathons/send_organizer_summaries_job.rb
              
              
                sampoder 1803fe7
              
                Merge branch 'main' into organizer-summary
              
              
                sampoder 8cb41e4
              
                Add a test
              
              
                sampoder 41afc2d
              
                Update organizer_summary_test.rb
              
              
                sampoder 9dec6ae
              
                Update test/mailers/hackathons/organizer_summary_test.rb
              
              
                sampoder 9095300
              
                Merge branch 'main' into organizer-summary
              
              
                sampoder 90e38fc
              
                Update app/jobs/hackathons/digests_delivery_job.rb
              
              
                sampoder 8539a84
              
                rename job
              
              
                sampoder 9d7c744
              
                move the test
              
              
                sampoder ee65871
              
                that was very bad of me
              
              
                sampoder 9adae8e
              
                run standard and pray
              
              
                sampoder 9fe0fdc
              
                Merge branch 'main' into organizer-summary
              
              
                northeastprince 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
    
  
  
    
              
              | Original file line number | Diff line number | Diff line change | 
|---|---|---|
| @@ -0,0 +1,18 @@ | ||
| class Hackathons::SendOrganizerSummariesJob < ApplicationJob | ||
| def perform(sent_digests) | ||
| # This reloads the (possible) sent_digests array as an | ||
| # ActiveRecord::Relation so that we can use includes to prevent an N+1. | ||
| @sent_digests = Hackathon::Digest.where(id: sent_digests.map(&:id)) | ||
| 
     | 
||
| @sent_digests_by_hackathons = @sent_digests | ||
| .includes(listings: {hackathon: {logo_attachment: :blob}}) | ||
                
      
                  sampoder marked this conversation as resolved.
               
              
                Outdated
          
            Show resolved
            Hide resolved
         | 
||
| .flat_map(&:listings).group_by(&:hackathon) | ||
| .transform_values { |listings| listings.map(&:digest).uniq } | ||
| 
     | 
||
| @listed_hackathons = @sent_digests_by_hackathons.keys | ||
| @listed_hackathons.each do |hackathon| | ||
| sent_digests = @digests_by_hackathons[hackathon] | ||
| Hackathons::DigestMailer.organizer_summary(sent_digests, hackathon).deliver_later if @sent_digests.any? | ||
                
      
                  sampoder marked this conversation as resolved.
               
              
                Outdated
          
            Show resolved
            Hide resolved
         | 
||
| 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
    
  
  
    
              
        
          
          
            10 changes: 10 additions & 0 deletions
          
          10 
        
  app/views/hackathons/digest_mailer/organizer_summary.html.erb
  
  
      
      
   
        
      
      
    
                              
      
                  sampoder marked this conversation as resolved.
               
          
            Show resolved
            Hide resolved
         | 
            
  
    
      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,10 @@ | ||
| 
     | 
||
| <p> | ||
| We've just sent an email about <%= @hackathon.name %> to <%= @count %> hackers. Let us know how things go! | ||
| </p> | ||
| 
     | 
||
| <% content_for :signature do %> | ||
| <p> | ||
| Best of luck with everything! 🦕 💸 | ||
| </p> | ||
| <% end %> | ||
                
      
                  sampoder marked this conversation as resolved.
               
          
            Show resolved
            Hide resolved
         | 
||
        
          
          
            5 changes: 5 additions & 0 deletions
          
          5 
        
  app/views/hackathons/digest_mailer/organizer_summary.text.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,5 @@ | ||
| We've just sent an email about <%= @hackathon.name %> to <%= @count %> hackers. Let us know how things go! | ||
                
      
                  sampoder marked this conversation as resolved.
               
              
                Outdated
          
            Show resolved
            Hide resolved
         | 
||
| 
     | 
||
| <% content_for :signature do %> | ||
| Best of luck with everything! 🦕 💸 | ||
| <% end %> | ||
  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.