# Hacks : notify-page-updates-for-tagged-books

essai 27 bookstack-module.json

dans  
nicolas@msi-01:/srv/bookstack$ nano docker-compose .yml

image: linuxserver/bookstack:26.03.20260315

##### Puis :

dans le .env !

nicolas@msi-01:/srv/bookstack$ sdock compose down &amp;&amp; sdock compose up -d  
nicolas@msi-01:/srv/bookstack$ sdockexec &lt;container\_name&gt; bash

root@597eaf963fbf:/# apk update &amp;&amp; apk add --no-cache php85-cli php85-mbstring php85-xml php85-zip  
<span style="white-space: pre-wrap;">root@597eaf963fbf:/# wget </span>[https://www.bookstackapp.com/hack-modules/notify-tagged-page-updates.zip](https://www.bookstackapp.com/hack-modules/notify-tagged-page-updates.zip)  
root@597eaf963fbf:/# mv notify-tagged-page-updates.zip /app/www/  
root@597eaf963fbf:/# cd /app/www/ &amp;&amp; php artisan bookstack:install-module notify-tagged-page-updates.zip  
root@597eaf963fbf:/# apk add nano  
root@597eaf963fbf:/# nano /app/www/themes/custom/modules/notify-page-updates-for-tagged-books/functions.php

Modif dans la fonction ;

> 24 public function toMail(User $notifiable): MailMessage  
> 25 {  
> 26 /\*\* @var Page $page \*/  
> 27 $page = $this-&gt;detail;  
> 28 $updater = $this-&gt;user;  
> 29  
> 30 return (new MailMessage())  
> 31 // -&gt;subject('BookStack page update notification')  
> 32 // -&gt;line("La page \\"{$page-&gt;name}\\" has been updated by \\"{$updater-&gt;name}\\"")  
> 33 -&gt;subject('BookStack : notification de mise à jour de page')  
> 34 -&gt;line("The page \\"{$page-&gt;name}\\" a été mise à jour par \\"{$updater-&gt;name}\\"")  
> 35 -&gt;action('View Page', $page-&gt;getUrl());  
> 36 }

root@597eaf963fbf:/# exit

puis :

nicolas@msi-01:/srv/bookstack$ sdock retart &lt;nom\_container&gt;

ATTENTION :

NOM DU TAG : notify en minuscule  
Rôles à pousser : casse identique au nom du rôle, plusieurs rôles séparés par une virgule.

Etat courant :

## Thème BookStack custom

### Modules installés

#### notify-page-updates-for-tagged-books

- Source : https://www.bookstackapp.com/hacks/notify-tagged-page-updates/
- Installé le : 2026-03-17
- Testé sur : v26.03

**Fonctionnement :**<span style="white-space: pre-wrap;"> Envoie un mail aux utilisateurs des rôles listés dans un tag </span>`<span class="editor-theme-code">notify</span>`<span style="white-space: pre-wrap;"> (séparateur virgule) appliqué au </span>**livre**<span style="white-space: pre-wrap;"> (pas au chapitre ni à la page).</span>

**Exemple de tag sur le livre :**

- <span style="white-space: pre-wrap;">Nom : </span>`<span class="editor-theme-code">notify</span>`
- <span style="white-space: pre-wrap;">Valeur : </span>`<span class="editor-theme-code">mn-et-nf,Admin</span>`

**Modifications apportées au functions.php original :**

- Textes des mails traduits en français
- Logs de debug ajoutés (niveau debug, silencieux en prod)

nouvelle fonction avec 1 mail tous les xxx

**Ce qui a changé par rapport à ton fichier actuel :**

- <span style="white-space: pre-wrap;">Constante </span>`<span class="editor-theme-code">NOTIFY_COOLDOWN_HOURS = 4</span>`<span style="white-space: pre-wrap;"> en haut du fichier — </span>**un seul endroit à modifier**<span style="white-space: pre-wrap;"> pour changer la fréquence</span>
- <span style="white-space: pre-wrap;">Le cooldown est vérifié </span>**avant**<span style="white-space: pre-wrap;"> toute requête SQL — si actif, on sort immédiatement sans toucher la base</span>
- <span style="white-space: pre-wrap;">Le cooldown est armé </span>**après**<span style="white-space: pre-wrap;"> l'envoi réussi des mails — si une erreur survient avant, le prochain enregistrement retente</span>
- <span style="white-space: pre-wrap;">Tous les </span>`<span class="editor-theme-code">\Log::info</span>`<span style="white-space: pre-wrap;"> remplacés par </span>`<span class="editor-theme-code">\Log::debug</span>`<span style="white-space: pre-wrap;"> — silencieux en prod, visibles si </span>`<span class="editor-theme-code">LOG_LEVEL=debug</span>`
- Message du mail entièrement en français