Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

Investigate Custom Devise Mailer

Aperta
#4,384 5 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
35/100
Tipo di issue
Refactoring
Chiarezza
Abbastanza chiara
Stato di attività
Ferma
Stack tecnologico
rails, ruby

Direzione di ricerca

Inizia da app/mailers/custom_devise_mailer.rb e spec/mailers/custom_devise_mailer_spec.rb, quindi esamina i commit storici e le pull request collegati per ricostruire il comportamento degli inviti. Verifica ogni criterio di completamento, conferma i controlli pertinenti sul mittente e sul ruolo ed esegui la spec del mailer; il lavoro è completato quando la logica è giustificata e ogni modifica necessaria è coperta da test.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

Summary

So we have a custom devise mailer that seems to be responsible for setting the subject line for Partner invitations.. Tests for reference

The code looks something like this:

if resource.has_role?(Role::PARTNER, :any) && resource.id == resource.partner.primary_user&.id
  # do something
elsif resource.has_role?(Role::PARTNER, :any) && resource.id != resource.partner.primary_user&.id
  # do something else

This code (I think at least) sends one message if the user being invited is the primary user for the Partner and another if they are not.

Criteria for Completion

Figure out if this code is correct:

  • Does it make sense to check for resource.has_role?(Role::PARTNER, :any) as opposed to a specific partner
  • does it make sense for these invitations to get sent from a Partner vs a Org?
  • Do they even get sent from a Partner and not an Org?
  • If we change the code to check for a specific partner will there be any issues?
  • If it seems reasonable and necessary make the change 🙂
Historical context:

The mailer was originally added here: https://github.com/rubyforgood/human-essentials/commit/ff961af7f5051ec6e05dd9cdd4d055b5e650431d. It simply changed the invite message for inviting Partners instead of Orgs.

    if resource.is_a?(PartnerUser)
      "You've been invited to be a partner with #{resource.partner.organization.name}"  

https://github.com/rubyforgood/human-essentials/pull/2232 allowed Partners to invite coworkers by checking that the inviter was the primary user for that Partner:

 if resource.is_a?(PartnerUser) && resource.id != resource.partner.primary_user&.id
      "You've been invited to #{resource.partner.name}'s partnerbase account"

https://github.com/rubyforgood/human-essentials/pull/3050 got rid of PartnerUsers and instead used partner_id

if resource.try(:partner_id) && resource.id == resource.partner.primary_user&.id
      "You've been invited to be a partner with #{resource.partner.organization.name}"

https://github.com/rubyforgood/human-essentials/pull/3117 finally when roles got added we started checking by role instead of partner_id

if resource.has_role?(Role::PARTNER, :any) && resource.id == resource.partner.primary_user&.id
      "You've been invited to be a partner with #{resource.partner.organization.name}"
Lingua principale
Ruby
Stelle
594
Fork
596
Merge medio
1g 10h
PR unite (30g)
11

Preparare l'ambiente

Apri in Codespaces

Avvia il container di sviluppo del progetto nel browser, con il tuo account GitHub.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di rubyforgood/human-essentials

Tutte le issue di rubyforgood/human-essentials

Issue simili

Altre issue su Ruby

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.