Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

Investigate Custom Devise Mailer

Đang mở
#4,384 5 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức phù hợp với người mới
35/100
Loại issue
Tái cấu trúc
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Đình trệ
Công nghệ
rails, ruby
Lĩnh vực
authentication, backend

Hướng nghiên cứu

Bắt đầu với app/mailers/custom_devise_mailer.rb và spec/mailers/custom_devise_mailer_spec.rb, sau đó xem xét các commit lịch sử và pull request được liên kết để theo dõi hành vi lời mời. Xác minh từng tiêu chí hoàn thành, xác nhận các kiểm tra liên quan đến sender và role, rồi chạy mailer spec; được coi là hoàn tất khi logic có cơ sở hợp lý và mọi thay đổi cần thiết đều được kiểm thử.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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}"
Ngôn ngữ chính
Ruby
Star
594
Fork
596
Merge trung bình
1 ngày 10 giờ
Pull request đã merge (30 ngày)
11

Chuẩn bị môi trường

Mở trong Codespaces

Khởi chạy dev container của dự án ngay trên trình duyệt, bằng tài khoản GitHub của bạn.

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của rubyforgood/human-essentials

Tất cả issue của rubyforgood/human-essentials

Issue tương tự

Thêm issue về Ruby

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.