Hacktoberfest 2026: los issues que los mantenedores marcaron para octubre, abiertos y aptos para principiantes. Explorar issues de Hacktoberfest

Investigate Custom Devise Mailer

Abierto
#4,384 5 comentarios 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
4/5
Tiempo estimado
3-5 días
Aptitud para principiantes
35/100
Tipo de issue
Refactorización
Claridad
Bastante claro
Estado de actividad
Estancado
Stack tecnológico
rails, ruby

Línea de trabajo

Comienza con app/mailers/custom_devise_mailer.rb y spec/mailers/custom_devise_mailer_spec.rb; después, revisa los commits históricos y pull requests enlazados para rastrear el comportamiento de las invitaciones. Verifica cada criterio de finalización, confirma las comprobaciones pertinentes del remitente y del rol, y ejecuta la especificación del mailer; se considera terminado cuando la lógica está justificada y cualquier cambio necesario está cubierto por pruebas.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

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}"
Lenguaje dominante
Ruby
Estrellas
594
Forks
596
Merge medio
1 d 17 h
PR fusionados (30 d)
12

Preparar el entorno

Abrir en Codespaces

Inicia el contenedor de desarrollo del proyecto en tu navegador, con tu propia cuenta de GitHub.

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de rubyforgood/human-essentials

Todos los issues de rubyforgood/human-essentials

Issues similares

Más issues de Ruby

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.