Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

最初の日報投稿通知をactive_delivery化する #5931

Conversation

akingo55
Copy link
Contributor

@akingo55 akingo55 commented Dec 12, 2022

Issue

概要

最初の日報投稿通知をactive_delivery化しました。
見た目の変更はありません。

変更確認方法

  1. feature/replace-notification-first-report-to-active-deliveryをローカルに取り込む
  2. muryouでログインし、初日報を公開する
  3. komagataでログインし、通知にmuryouユーザーが初日報書いたことが通知されていることを確認する
  4. http://localhost:3000/letter_opener/にアクセスし、メールが届いていることを確認する

Screenshot

見た目の変更はありません。
image
image

変更前

変更後

@akingo55 akingo55 self-assigned this Dec 12, 2022
@akingo55 akingo55 force-pushed the feature/replace-notification-first-report-to-active-delivery branch from b324db9 to be871eb Compare December 17, 2022 07:18
@komagata
Copy link
Member

@akingo55 卒業通知のメールが送られていなかった問題を修正したのでmainブランチを取り込んだ上でこちらを参考にして実装していただければありがたいです〜

#5939

@akingo55 akingo55 force-pushed the feature/replace-notification-first-report-to-active-delivery branch from be871eb to d0f70dc Compare December 18, 2022 07:42
@akingo55 akingo55 force-pushed the feature/replace-notification-first-report-to-active-delivery branch from dcd7639 to 2d5a4cb Compare December 26, 2022 11:48
@akingo55 akingo55 marked this pull request as ready for review December 28, 2022 13:38
@akingo55
Copy link
Contributor Author

@dowdiness
お疲れ様です!
こちらのPRのレビューを依頼しても良いでしょうか?:pray:
お手隙に確認よろしくお願いします。

Copy link
Contributor

@dowdiness dowdiness left a comment

Choose a reason for hiding this comment

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

レビュー依頼ありがとうございますー!
のんびりしていたら返信するのが遅くなってしまいました。すいません。

使われなくなったメソッドとテストを消していなくて追加のテストが必要なことと、バグが見つかったので対応が必要なことを書きました。

確認よろしくお願いします。

= render '/notification_mailer/notification_mailer_template', title: "#{@report.user.login_name}さんのはじめての日報です!", link_url: notification_url(@notification), link_text: 'この日報へ' do
p #{@report.user.login_name}さんのはじめての日報です。歓迎のコメントを投稿しよう!!
div(style='border-top: solid 1px #ccc; height: 0;')
= md2html(@report.description)
Copy link
Contributor

Choose a reason for hiding this comment

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

コレも上と同じようにこのslimが作られた後はNotificationMailerの方のfirst_report.html.slimはもう使わないと思うので消してしまったほうが良いと思います。

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ご指摘ありがとうございます:pray:
こちら対応しました!

@notification = @user.notifications.find_by(link: "/reports/#{@report.id}")
mail to: @user.email,
subject: "[FBC] #{@report.user.login_name}さんがはじめての日報を書きました!"
end
Copy link
Contributor

Choose a reason for hiding this comment

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

ActivityMailerを使う場合はNotificationMailerの方のfirst_reportはもう使わないと思うので消してしまったほうが良いと思いました。

NotificationMailerの使われているnotification_mailer_previewとnotification_mailer_testにあるテストも消してしまって、ActivityMailerを使う形でactivity_mailer_previewにテストを追加したら良いと思います。

メールのプレビューの確認はhttp://localhost:3000/rails/mailers で出来ます。

それと、サイト内通知より先にメール通知が送られるとエラーになる問題があるそうなので対応したほうが良さそうです。

#6001

を確認してみてください。

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@dowdiness
不要なもの削除しました!

NotificationMailerの使われているnotification_mailer_previewとnotification_mailer_testにあるテストも消してしまって、ActivityMailerを使う形でactivity_mailer_previewにテストを追加したら良いと思います。

ActivityMailerのテストは追加済みです!

それと、サイト内通知より先にメール通知が送られるとエラーになる問題があるそうなので対応したほうが良さそうです。

ありがとうございます!こちらも対応しました!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@dowdiness
念の為こちらリマインドです:pray:
指摘していただいた点修正しましたので、再度ご確認お願いします!

Copy link
Contributor

Choose a reason for hiding this comment

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

@akingo55
お疲れ様です。返信遅くなってしまいすいません。モチベーションが落ちてあまり作業できてませんでした。

サイト内通知より先にメール通知が送られるとエラーになる問題の対応は問題なさそうです👍

activity_mailer_previewにテストを追加したら良いというのが説明不足で分かりにくかったと思います。

ActivityMailerのテストが無いという意味ではなく、https://github.com/fjordllc/bootcamp/blob/main/test/mailers/previews/activity_mailer_preview.rb
にメールのプレビュー用のテストを追加したら http://localhost:3000/rails/mailers でメールのプレビューが確認出来るようになるので、テストを追加した方が良いなと思ったという意味で書きました。

遅くなって申し訳ないですが対応よろしくおねがいします🙇‍♂️

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@dowdiness
なるほど、、、!理解しました:pray:
こちらメールのプレビュー用テストを追加しましたのでご確認お願いしますmm
baf6594

@akingo55 akingo55 force-pushed the feature/replace-notification-first-report-to-active-delivery branch from 64506f4 to a1712f7 Compare January 9, 2023 10:08
@akingo55 akingo55 force-pushed the feature/replace-notification-first-report-to-active-delivery branch 2 times, most recently from 4b6e73e to 00e7e3e Compare January 30, 2023 11:19
@akingo55 akingo55 force-pushed the feature/replace-notification-first-report-to-active-delivery branch from 00e7e3e to a69c0c9 Compare February 4, 2023 08:45
Copy link
Member

@komagata komagata left a comment

Choose a reason for hiding this comment

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

conflictの修正をお願いします〜

@akingo55 akingo55 force-pushed the feature/replace-notification-first-report-to-active-delivery branch 3 times, most recently from 41684f8 to 1a577a9 Compare February 15, 2023 00:51
@akingo55
Copy link
Contributor Author

conflictの修正をお願いします〜

@komagata
修正完了しました!ご確認お願いします!

Copy link
Member

@komagata komagata left a comment

Choose a reason for hiding this comment

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

conflictの修正をお願いします〜

@akingo55 akingo55 force-pushed the feature/replace-notification-first-report-to-active-delivery branch 2 times, most recently from 54e6959 to ea4951d Compare February 20, 2023 11:19
@akingo55
Copy link
Contributor Author

@komagata
修正しましたので、ご確認お願いします!

Copy link
Member

@komagata komagata left a comment

Choose a reason for hiding this comment

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

度々すみません、conflictの修正をお願いします〜

@akingo55 akingo55 force-pushed the feature/replace-notification-first-report-to-active-delivery branch from ea4951d to be9029e Compare March 1, 2023 14:10
@akingo55
Copy link
Contributor Author

akingo55 commented Mar 2, 2023

@komagata
修正完了です!

Copy link
Contributor

@dowdiness dowdiness left a comment

Choose a reason for hiding this comment

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

遅れてすいません🙏
もう既にkomagataさんのレビューに進んでいて問題無いのでApproveします

@mono-nobe
Copy link
Contributor

mono-nobe commented Mar 5, 2023

@akingo55 @komagata
横から失礼します 🙇

おそらく、こちらと同様の問題が発生していそうです。。
feature/replace-notification-first-report-to-active-deliveryブランチで、PRに記載いただいている手順通りに動作確認したところ、メールが対象者全員に送信されず、上記コメントと同じような挙動をしていました。
ご確認をよろしくお願いします。

@komagata
Copy link
Member

@akingo55 conflictの解消をお願いします。

@akingo55 akingo55 force-pushed the feature/replace-notification-first-report-to-active-delivery branch from be9029e to df6c216 Compare March 26, 2023 13:17
@akingo55
Copy link
Contributor Author

@ akingo55 conflictの解消をお願いします。

@komagata
修正しました、確認お願いします。
コンフリクトしやすいので早めにレビューいただけると助かります。

@mono-nobe
Copy link
Contributor

@akingo55 CC @komagata

#5931 (comment)

コメントご確認いただけましたでしょうか?
念の為、再度ローカルで動作確認しましたが、やはり正常に動作していないように思われます。
(もし仕様を勘違いしていたらごめんなさい。)

スクリーンショット 2023-03-27 1 46 40

スクリーンショット 2023-03-27 1 57 59

@@ -31,7 +31,7 @@ def create_author_watch(report)

def notify_first_report(report)
User.admins_and_mentors.each do |receiver|
Copy link
Contributor

@mono-nobe mono-nobe Mar 26, 2023

Choose a reason for hiding this comment

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

@akingo55

User.admins_and_mentors

メール送信対象者は管理者とメンターであると理解しており、現状そこが満たされていない気がしております。

@machida
Copy link
Member

machida commented May 15, 2023

#6504
こちらで続きを行っているのでクローズにします。

@machida machida closed this May 15, 2023
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.

5 participants