Investigate Custom Devise Mailer
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 新手友好度
- 35/100
- Issue 类型
- 重构
- 描述清晰度
- 基本清楚
- 活跃度
- 停滞
调研方向
先从 app/mailers/custom_devise_mailer.rb 和 spec/mailers/custom_devise_mailer_spec.rb 开始,然后查看链接的历史提交和 pull request,以追踪邀请行为。验证每项完成标准,确认相关的发送者和角色检查,并运行 mailer spec;完成意味着逻辑有充分依据,且任何必要的更改都已由测试覆盖。
由索引模型根据 Issue 内容生成。
描述
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}"
- 主要语言
- Ruby
- 星标
- 594
- 派生
- 596
- 平均合并
- 1 天 17 小时
- 30 天内合并 PR
- 12
环境准备
在浏览器里用你自己的 GitHub 账号启动这个项目的开发容器。
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
rubyforgood/human-essentials 的其他 Issue
-
Export button on annual report should revert to "Export Report" from "Please Wait..." once report generated.可能已有人在做 @costajohnt 于 17 天前认领。 未关闭
难度 2/5 1-3 小时 新手友好度 74/100
rubyforgood/human-essentials#5691 · 1 条评论 · 已指派 1 人 ·
维护者通常 1 天内回复
-
stale
难度 2/5 1-3 小时 新手友好度 68/100
rubyforgood/human-essentials#5603 · 8 条评论 · 已指派 1 人 ·
维护者通常 1 天内回复
-
Proposal: forecast-based reorder points and shortage allocation ("Replenishment Planner")可能已有人在做 @arnavt687 于 20 天前认领。 未关闭
难度 5/5 一周以上 新手友好度 25/100
rubyforgood/human-essentials#5728 · 3 条评论 ·
维护者通常 1 天内回复
-
Ruby for Good 2026 DC stale
rubyforgood/human-essentials#5694 · 2 条评论 ·
维护者通常 1 天内回复
-
Add optional phone number to users (esp Partner Users)可能已有人在做 @costajohnt 于 22 天前认领。 未关闭Difficulty—Intermediate Ruby for Good 2026 DC
难度 3/5 1-2 天 新手友好度 68/100
rubyforgood/human-essentials#5687 ·
维护者通常 1 天内回复
查看 rubyforgood/human-essentials 的全部 Issue
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 78/100
维护者通常 8 天内回复
-
难度 2/5 1-3 小时 新手友好度 72/100
维护者通常 1 天内回复
-
bug
难度 2/5 1-3 小时 新手友好度 76/100
drwl/annotaterb#406 ·
维护者通常 2 天内回复
-
bug: "Conversation information" accordion renders blank with 0px height when conversation has no attributes可能已有人在做 @gihovani 今天认领。 未关闭
难度 1/5 1 小时以内 新手友好度 88/100
维护者通常 2 天内回复
-
`hanami generate repository` would be a nice alias for `hanami generate repo`可能已有人在做 @sandbergja 今天认领。 未关闭bug help wanted
难度 2/5 1-3 小时 新手友好度 74/100
hanami/hanami-cli#455 ·