-
Notifications
You must be signed in to change notification settings - Fork 91
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: notify administrateur and gestionnaire by email when new commen…
…taire + for administrateur highlight card and commentaires if any unread
- Loading branch information
seb-by-ouidou
committed
Jan 31, 2024
1 parent
3ea718a
commit 5e7f3c6
Showing
20 changed files
with
160 additions
and
35 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
2 changes: 1 addition & 1 deletion
2
app/views/gestionnaires/groupe_gestionnaire_commentaires/destroy.turbo_stream.haml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
- if @last_commentaire.discarded? | ||
= turbo_stream.update @last_commentaire do | ||
= render(GroupeGestionnaire::GroupeGestionnaireCommentaires::CommentaireComponent.new(commentaire: @last_commentaire, connected_user: current_gestionnaire)) | ||
= render(GroupeGestionnaire::GroupeGestionnaireCommentaires::CommentaireComponent.new(commentaire: @last_commentaire, connected_user: current_gestionnaire, commentaire_seen_at: @commentaire_seen_at)) |
12 changes: 12 additions & 0 deletions
12
app/views/groupe_gestionnaire_mailer/notify_new_commentaire_groupe_gestionnaire.html.haml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
- content_for(:title, "#{@subject}") | ||
|
||
%p= t(:hello, scope: [:views, :shared, :greetings]) | ||
|
||
%p | ||
= t('.body', groupe_gestionnaire_name: @groupe_gestionnaire.name, sender_email: @sender_email) | ||
%p= round_button("consulter le message", @commentaire_url, :primary) | ||
|
||
= render partial: "layouts/mailers/signature" | ||
|
||
- content_for :footer do | ||
= render 'layouts/mailers/commentaire_groupe_gestionnaire_footer' |
2 changes: 2 additions & 0 deletions
2
app/views/layouts/mailers/_commentaire_groupe_gestionnaire_footer.html.haml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
%strong | ||
= t('.do_not_reply_html', application_name: APPLICATION_NAME, sender_email: @sender_email) |
4 changes: 4 additions & 0 deletions
4
...ocales/views/groupe_gestionnaire_mailer/notify_new_commentaire_groupe_gestionnaire/fr.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
fr: | ||
groupe_gestionnaire_mailer: | ||
notify_new_commentaire_groupe_gestionnaire: | ||
body: Vous avez un nouveau message envoyé de la part de %{sender_email} dans la messagerie du groupe gestionnaire %{groupe_gestionnaire_name} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 5 additions & 0 deletions
5
db/migrate/20231106104916_add_commentaire_seen_at_to_administrateurs.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
class AddCommentaireSeenAtToAdministrateurs < ActiveRecord::Migration[6.1] | ||
def change | ||
add_column :administrateurs, :commentaire_seen_at, :datetime | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.