Skip to content

Jelly forwarding#65

Open
transcental wants to merge 8 commits into
platformfrom
jelly-forwarding
Open

Jelly forwarding#65
transcental wants to merge 8 commits into
platformfrom
jelly-forwarding

Conversation

@transcental
Copy link
Copy Markdown
Member

Currently ALL emails to stardance@hackclub.com are sent to Jelly which includes "Hey Stardance" RSVP confirmations and people playing tic tac toe. This PR uses a combination of filtering and AI detection to figure out which emails should be sent to the support team on Jelly. I've tested this as much as I can locally - the forwarding logic with the Action Mailer has not been tested.

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR reduces noise in Jelly by adding logic to selectively forward inbound emails sent to stardance@hackclub.com to the support team, using a mix of simple filters and an AI classifier. It also introduces a dedicated mailer to forward the inbound message and expands mailbox tests to cover the new forwarding behavior.

Changes:

  • Add Rsvp::ReplyMailbox#should_forward? to decide when to forward inbound messages to Jelly, and skip local tic-tac-toe processing when forwarded.
  • Add SupportMailer.forward to forward inbound emails to the Jelly support address.
  • Improve AI service plumbing (OpenAI key via Rails credentials fallback; raise on non-200 responses) and add tests for forwarding scenarios.

Reviewed changes

Copilot reviewed 6 out of 7 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
test/mailboxes/rsvp/reply_mailbox_test.rb Adds tests for forwarding behavior and stubs the AI classifier.
config/credentials/production.yml.enc Updates production credentials (likely for AI key/config).
config/credentials/development.yml.enc Updates development credentials (likely for AI key/config).
app/services/openai_api_service.rb Uses Rails credentials for OPENAI_API_KEY with ENV fallback.
app/services/ai_service.rb Adds non-200 response handling for AI HTTP calls.
app/mailers/support_mailer.rb New mailer for forwarding inbound emails to Jelly support.
app/mailboxes/rsvp/reply_mailbox.rb Implements forwarding decision + forwarding side-effect in the mailbox.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread test/mailboxes/rsvp/reply_mailbox_test.rb
Comment thread test/mailboxes/rsvp/reply_mailbox_test.rb
Comment thread app/mailers/support_mailer.rb
Comment thread app/mailboxes/rsvp/reply_mailbox.rb Outdated
Comment thread app/mailboxes/rsvp/reply_mailbox.rb
Comment on lines +17 to +19
unless response.code == "200"
raise "AI API error: #{response.code} - #{response.body}"
end
Comment thread app/mailers/support_mailer.rb Outdated
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants