acb8225d316e195fd1d2765e9b0333752e60b1a5
[GitHub/WoltLab/woltlab.github.io.git] / 5.4 / php / api / user_notifications / index.html
1
2 <!doctype html>
3 <html lang="en" class="no-js">
4 <head>
5
6 <meta charset="utf-8">
7 <meta name="viewport" content="width=device-width,initial-scale=1">
8
9
10
11
12 <link rel="canonical" href="https://docs.woltlab.com/5.4/php/api/user_notifications/">
13
14 <link rel="icon" href="../../../assets/default.favicon.ico">
15 <meta name="generator" content="mkdocs-1.1.2, mkdocs-material-7.1.2">
16
17
18
19 <title>User Notifications - WoltLab Suite Documentation</title>
20
21
22
23 <link rel="stylesheet" href="../../../assets/stylesheets/main.6f955dcd.min.css">
24
25
26 <link rel="stylesheet" href="../../../assets/stylesheets/palette.ef6f36e2.min.css">
27
28
29
30 <meta name="theme-color" content="#009485">
31
32
33
34
35
36
37
38
39
40 <link rel="stylesheet" href="../../../stylesheets/extra.css">
41
42
43
44
45
46 </head>
47
48
49
50
51
52
53
54 <body dir="ltr" data-md-color-scheme="" data-md-color-primary="teal" data-md-color-accent="">
55
56
57 <script>function __prefix(e){return new URL("../../..",location).pathname+"."+e}function __get(e,t=localStorage){return JSON.parse(t.getItem(__prefix(e)))}</script>
58
59 <input class="md-toggle" data-md-toggle="drawer" type="checkbox" id="__drawer" autocomplete="off">
60 <input class="md-toggle" data-md-toggle="search" type="checkbox" id="__search" autocomplete="off">
61 <label class="md-overlay" for="__drawer"></label>
62 <div data-md-component="skip">
63
64
65 <a href="#user-notifications" class="md-skip">
66 Skip to content
67 </a>
68
69 </div>
70 <div data-md-component="announce">
71
72 <aside class="md-announce">
73 <div class="md-announce__inner md-grid md-typeset">
74
75 <a href="https://www.woltlab.com">Back to <strong>woltlab.com</strong></a>
76
77 </div>
78 </aside>
79
80 </div>
81
82 <header class="md-header" data-md-component="header">
83 <nav class="md-header__inner md-grid" aria-label="Header">
84 <a href="../../.." title="WoltLab Suite Documentation" class="md-header__button md-logo" aria-label="WoltLab Suite Documentation" data-md-component="logo">
85
86 <img src="../../../assets/logo.png" alt="logo">
87
88 </a>
89 <label class="md-header__button md-icon" for="__drawer">
90 <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M3 6h18v2H3V6m0 5h18v2H3v-2m0 5h18v2H3v-2z"/></svg>
91 </label>
92 <div class="md-header__title" data-md-component="header-title">
93 <div class="md-header__ellipsis">
94 <div class="md-header__topic">
95 <span class="md-ellipsis">
96 WoltLab Suite Documentation
97 </span>
98 </div>
99 <div class="md-header__topic" data-md-component="header-topic">
100 <span class="md-ellipsis">
101
102 User Notifications
103
104 </span>
105 </div>
106 </div>
107 </div>
108
109
110
111 <label class="md-header__button md-icon" for="__search">
112 <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M9.5 3A6.5 6.5 0 0 1 16 9.5c0 1.61-.59 3.09-1.56 4.23l.27.27h.79l5 5-1.5 1.5-5-5v-.79l-.27-.27A6.516 6.516 0 0 1 9.5 16 6.5 6.5 0 0 1 3 9.5 6.5 6.5 0 0 1 9.5 3m0 2C7 5 5 7 5 9.5S7 14 9.5 14 14 12 14 9.5 12 5 9.5 5z"/></svg>
113 </label>
114
115 <div class="md-search" data-md-component="search" role="dialog">
116 <label class="md-search__overlay" for="__search"></label>
117 <div class="md-search__inner" role="search">
118 <form class="md-search__form" name="search">
119 <input type="text" class="md-search__input" name="query" aria-label="Search" placeholder="Search" autocapitalize="off" autocorrect="off" autocomplete="off" spellcheck="false" data-md-component="search-query" data-md-state="active" required>
120 <label class="md-search__icon md-icon" for="__search">
121 <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M9.5 3A6.5 6.5 0 0 1 16 9.5c0 1.61-.59 3.09-1.56 4.23l.27.27h.79l5 5-1.5 1.5-5-5v-.79l-.27-.27A6.516 6.516 0 0 1 9.5 16 6.5 6.5 0 0 1 3 9.5 6.5 6.5 0 0 1 9.5 3m0 2C7 5 5 7 5 9.5S7 14 9.5 14 14 12 14 9.5 12 5 9.5 5z"/></svg>
122 <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M20 11v2H8l5.5 5.5-1.42 1.42L4.16 12l7.92-7.92L13.5 5.5 8 11h12z"/></svg>
123 </label>
124 <button type="reset" class="md-search__icon md-icon" aria-label="Clear" tabindex="-1">
125 <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M19 6.41 17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"/></svg>
126 </button>
127 </form>
128 <div class="md-search__output">
129 <div class="md-search__scrollwrap" data-md-scrollfix>
130 <div class="md-search-result" data-md-component="search-result">
131 <div class="md-search-result__meta">
132 Initializing search
133 </div>
134 <ol class="md-search-result__list"></ol>
135 </div>
136 </div>
137 </div>
138 </div>
139 </div>
140
141
142 <div class="md-header__source">
143
144 <a href="https://github.com/WoltLab/docs.woltlab.com/" title="Go to repository" class="md-source" data-md-component="source">
145 <div class="md-source__icon md-icon">
146
147 <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512"><path d="M439.55 236.05 244 40.45a28.87 28.87 0 0 0-40.81 0l-40.66 40.63 51.52 51.52c27.06-9.14 52.68 16.77 43.39 43.68l49.66 49.66c34.23-11.8 61.18 31 35.47 56.69-26.49 26.49-70.21-2.87-56-37.34L240.22 199v121.85c25.3 12.54 22.26 41.85 9.08 55a34.34 34.34 0 0 1-48.55 0c-17.57-17.6-11.07-46.91 11.25-56v-123c-20.8-8.51-24.6-30.74-18.64-45L142.57 101 8.45 235.14a28.86 28.86 0 0 0 0 40.81l195.61 195.6a28.86 28.86 0 0 0 40.8 0l194.69-194.69a28.86 28.86 0 0 0 0-40.81z"/></svg>
148 </div>
149 <div class="md-source__repository">
150 GitHub
151 </div>
152 </a>
153 </div>
154
155 </nav>
156 </header>
157
158 <div class="md-container" data-md-component="container">
159
160
161
162
163 <main class="md-main" data-md-component="main">
164 <div class="md-main__inner md-grid">
165
166
167
168 <div class="md-sidebar md-sidebar--primary" data-md-component="sidebar" data-md-type="navigation" >
169 <div class="md-sidebar__scrollwrap">
170 <div class="md-sidebar__inner">
171
172
173
174 <nav class="md-nav md-nav--primary" aria-label="Navigation" data-md-level="0">
175 <label class="md-nav__title" for="__drawer">
176 <a href="../../.." title="WoltLab Suite Documentation" class="md-nav__button md-logo" aria-label="WoltLab Suite Documentation" data-md-component="logo">
177
178 <img src="../../../assets/logo.png" alt="logo">
179
180 </a>
181 WoltLab Suite Documentation
182 </label>
183
184 <div class="md-nav__source">
185
186 <a href="https://github.com/WoltLab/docs.woltlab.com/" title="Go to repository" class="md-source" data-md-component="source">
187 <div class="md-source__icon md-icon">
188
189 <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512"><path d="M439.55 236.05 244 40.45a28.87 28.87 0 0 0-40.81 0l-40.66 40.63 51.52 51.52c27.06-9.14 52.68 16.77 43.39 43.68l49.66 49.66c34.23-11.8 61.18 31 35.47 56.69-26.49 26.49-70.21-2.87-56-37.34L240.22 199v121.85c25.3 12.54 22.26 41.85 9.08 55a34.34 34.34 0 0 1-48.55 0c-17.57-17.6-11.07-46.91 11.25-56v-123c-20.8-8.51-24.6-30.74-18.64-45L142.57 101 8.45 235.14a28.86 28.86 0 0 0 0 40.81l195.61 195.6a28.86 28.86 0 0 0 40.8 0l194.69-194.69a28.86 28.86 0 0 0 0-40.81z"/></svg>
190 </div>
191 <div class="md-source__repository">
192 GitHub
193 </div>
194 </a>
195 </div>
196
197 <ul class="md-nav__list" data-md-scrollfix>
198
199
200
201
202
203
204
205
206 <li class="md-nav__item">
207 <a href="../../../getting-started/" class="md-nav__link">
208 Getting Started
209 </a>
210 </li>
211
212
213
214
215
216
217
218
219
220
221
222
223
224 <li class="md-nav__item md-nav__item--active md-nav__item--nested">
225
226
227 <input class="md-nav__toggle md-toggle" data-md-toggle="__nav_2" type="checkbox" id="__nav_2" checked>
228
229 <label class="md-nav__link" for="__nav_2">
230 PHP API
231 <span class="md-nav__icon md-icon"></span>
232 </label>
233 <nav class="md-nav" aria-label="PHP API" data-md-level="1">
234 <label class="md-nav__title" for="__nav_2">
235 <span class="md-nav__icon md-icon"></span>
236 PHP API
237 </label>
238 <ul class="md-nav__list" data-md-scrollfix>
239
240
241
242
243
244 <li class="md-nav__item">
245 <a href="../../pages/" class="md-nav__link">
246 Pages
247 </a>
248 </li>
249
250
251
252
253
254
255
256 <li class="md-nav__item">
257 <a href="../../database-objects/" class="md-nav__link">
258 Database Objects
259 </a>
260 </li>
261
262
263
264
265
266
267
268 <li class="md-nav__item">
269 <a href="../../database-access/" class="md-nav__link">
270 Database Access
271 </a>
272 </li>
273
274
275
276
277
278
279
280 <li class="md-nav__item">
281 <a href="../../exceptions/" class="md-nav__link">
282 Exceptions
283 </a>
284 </li>
285
286
287
288
289
290
291
292
293
294
295 <li class="md-nav__item md-nav__item--active md-nav__item--nested">
296
297
298 <input class="md-nav__toggle md-toggle" data-md-toggle="__nav_2_5" type="checkbox" id="__nav_2_5" checked>
299
300 <label class="md-nav__link" for="__nav_2_5">
301 API
302 <span class="md-nav__icon md-icon"></span>
303 </label>
304 <nav class="md-nav" aria-label="API" data-md-level="2">
305 <label class="md-nav__title" for="__nav_2_5">
306 <span class="md-nav__icon md-icon"></span>
307 API
308 </label>
309 <ul class="md-nav__list" data-md-scrollfix>
310
311
312
313
314
315
316 <li class="md-nav__item md-nav__item--nested">
317
318
319 <input class="md-nav__toggle md-toggle" data-md-toggle="__nav_2_5_1" type="checkbox" id="__nav_2_5_1" >
320
321 <label class="md-nav__link" for="__nav_2_5_1">
322 Caches
323 <span class="md-nav__icon md-icon"></span>
324 </label>
325 <nav class="md-nav" aria-label="Caches" data-md-level="3">
326 <label class="md-nav__title" for="__nav_2_5_1">
327 <span class="md-nav__icon md-icon"></span>
328 Caches
329 </label>
330 <ul class="md-nav__list" data-md-scrollfix>
331
332
333
334
335
336 <li class="md-nav__item">
337 <a href="../caches/" class="md-nav__link">
338 Overview
339 </a>
340 </li>
341
342
343
344
345
346
347
348 <li class="md-nav__item">
349 <a href="../caches_persistent-caches/" class="md-nav__link">
350 Persistent Caches
351 </a>
352 </li>
353
354
355
356
357
358
359
360 <li class="md-nav__item">
361 <a href="../caches_runtime-caches/" class="md-nav__link">
362 Runtime Caches
363 </a>
364 </li>
365
366
367
368 </ul>
369 </nav>
370 </li>
371
372
373
374
375
376
377
378 <li class="md-nav__item">
379 <a href="../comments/" class="md-nav__link">
380 Comments
381 </a>
382 </li>
383
384
385
386
387
388
389
390 <li class="md-nav__item">
391 <a href="../cronjobs/" class="md-nav__link">
392 Cronjobs
393 </a>
394 </li>
395
396
397
398
399
400
401
402 <li class="md-nav__item">
403 <a href="../events/" class="md-nav__link">
404 Events
405 </a>
406 </li>
407
408
409
410
411
412
413
414
415 <li class="md-nav__item md-nav__item--nested">
416
417
418 <input class="md-nav__toggle md-toggle" data-md-toggle="__nav_2_5_5" type="checkbox" id="__nav_2_5_5" >
419
420 <label class="md-nav__link" for="__nav_2_5_5">
421 Form Builder
422 <span class="md-nav__icon md-icon"></span>
423 </label>
424 <nav class="md-nav" aria-label="Form Builder" data-md-level="3">
425 <label class="md-nav__title" for="__nav_2_5_5">
426 <span class="md-nav__icon md-icon"></span>
427 Form Builder
428 </label>
429 <ul class="md-nav__list" data-md-scrollfix>
430
431
432
433
434
435 <li class="md-nav__item">
436 <a href="../form_builder/overview/" class="md-nav__link">
437 Overview
438 </a>
439 </li>
440
441
442
443
444
445
446
447 <li class="md-nav__item">
448 <a href="../form_builder/structure/" class="md-nav__link">
449 Structure
450 </a>
451 </li>
452
453
454
455
456
457
458
459 <li class="md-nav__item">
460 <a href="../form_builder/form_fields/" class="md-nav__link">
461 Fields
462 </a>
463 </li>
464
465
466
467
468
469
470
471 <li class="md-nav__item">
472 <a href="../form_builder/validation_data/" class="md-nav__link">
473 Validation and Data
474 </a>
475 </li>
476
477
478
479
480
481
482
483 <li class="md-nav__item">
484 <a href="../form_builder/dependencies/" class="md-nav__link">
485 Dependencies
486 </a>
487 </li>
488
489
490
491 </ul>
492 </nav>
493 </li>
494
495
496
497
498
499
500
501 <li class="md-nav__item">
502 <a href="../package_installation_plugins/" class="md-nav__link">
503 Package Installation Plugins
504 </a>
505 </li>
506
507
508
509
510
511
512
513 <li class="md-nav__item">
514 <a href="../user_activity_points/" class="md-nav__link">
515 User Activity Points
516 </a>
517 </li>
518
519
520
521
522
523
524
525
526
527 <li class="md-nav__item md-nav__item--active">
528
529 <input class="md-nav__toggle md-toggle" data-md-toggle="toc" type="checkbox" id="__toc">
530
531
532
533
534
535 <label class="md-nav__link md-nav__link--active" for="__toc">
536 User Notifications
537 <span class="md-nav__icon md-icon"></span>
538 </label>
539
540 <a href="./" class="md-nav__link md-nav__link--active">
541 User Notifications
542 </a>
543
544
545 <nav class="md-nav md-nav--secondary" aria-label="Table of contents">
546
547
548
549
550
551
552 <label class="md-nav__title" for="__toc">
553 <span class="md-nav__icon md-icon"></span>
554 Table of contents
555 </label>
556 <ul class="md-nav__list" data-md-component="toc" data-md-scrollfix>
557
558 <li class="md-nav__item">
559 <a href="#objecttypexml" class="md-nav__link">
560 objectType.xml
561 </a>
562
563 </li>
564
565 <li class="md-nav__item">
566 <a href="#usernotificationeventxml" class="md-nav__link">
567 userNotificationEvent.xml
568 </a>
569
570 </li>
571
572 <li class="md-nav__item">
573 <a href="#firing-events" class="md-nav__link">
574 Firing Events
575 </a>
576
577 </li>
578
579 <li class="md-nav__item">
580 <a href="#marking-notifications-as-confirmed" class="md-nav__link">
581 Marking Notifications as Confirmed
582 </a>
583
584 </li>
585
586 </ul>
587
588 </nav>
589
590 </li>
591
592
593
594
595
596
597
598 <li class="md-nav__item">
599 <a href="../sitemaps/" class="md-nav__link">
600 Sitemaps
601 </a>
602 </li>
603
604
605
606 </ul>
607 </nav>
608 </li>
609
610
611
612
613
614
615
616 <li class="md-nav__item">
617 <a href="../../code-style/" class="md-nav__link">
618 Code Style
619 </a>
620 </li>
621
622
623
624
625
626
627
628 <li class="md-nav__item">
629 <a href="../../apps/" class="md-nav__link">
630 Apps
631 </a>
632 </li>
633
634
635
636
637
638
639
640 <li class="md-nav__item">
641 <a href="../../gdpr/" class="md-nav__link">
642 GDPR
643 </a>
644 </li>
645
646
647
648 </ul>
649 </nav>
650 </li>
651
652
653
654
655
656
657
658
659
660
661
662 <li class="md-nav__item md-nav__item--nested">
663
664
665 <input class="md-nav__toggle md-toggle" data-md-toggle="__nav_3" type="checkbox" id="__nav_3" >
666
667 <label class="md-nav__link" for="__nav_3">
668 Languages, Templates & CSS
669 <span class="md-nav__icon md-icon"></span>
670 </label>
671 <nav class="md-nav" aria-label="Languages, Templates & CSS" data-md-level="1">
672 <label class="md-nav__title" for="__nav_3">
673 <span class="md-nav__icon md-icon"></span>
674 Languages, Templates & CSS
675 </label>
676 <ul class="md-nav__list" data-md-scrollfix>
677
678
679
680
681
682 <li class="md-nav__item">
683 <a href="../../../view/languages/" class="md-nav__link">
684 Languages
685 </a>
686 </li>
687
688
689
690
691
692
693
694 <li class="md-nav__item">
695 <a href="../../../view/templates/" class="md-nav__link">
696 Templates
697 </a>
698 </li>
699
700
701
702
703
704
705
706 <li class="md-nav__item">
707 <a href="../../../view/template-plugins/" class="md-nav__link">
708 Template Plugins
709 </a>
710 </li>
711
712
713
714
715
716
717
718 <li class="md-nav__item">
719 <a href="../../../view/css/" class="md-nav__link">
720 CSS
721 </a>
722 </li>
723
724
725
726 </ul>
727 </nav>
728 </li>
729
730
731
732
733
734
735
736
737
738
739
740 <li class="md-nav__item md-nav__item--nested">
741
742
743 <input class="md-nav__toggle md-toggle" data-md-toggle="__nav_4" type="checkbox" id="__nav_4" >
744
745 <label class="md-nav__link" for="__nav_4">
746 TypeScript and JavaScript API
747 <span class="md-nav__icon md-icon"></span>
748 </label>
749 <nav class="md-nav" aria-label="TypeScript and JavaScript API" data-md-level="1">
750 <label class="md-nav__title" for="__nav_4">
751 <span class="md-nav__icon md-icon"></span>
752 TypeScript and JavaScript API
753 </label>
754 <ul class="md-nav__list" data-md-scrollfix>
755
756
757
758
759
760 <li class="md-nav__item">
761 <a href="../../../javascript/general-usage/" class="md-nav__link">
762 General Usage
763 </a>
764 </li>
765
766
767
768
769
770
771
772 <li class="md-nav__item">
773 <a href="../../../javascript/typescript/" class="md-nav__link">
774 TypeScript
775 </a>
776 </li>
777
778
779
780
781
782
783
784
785 <li class="md-nav__item md-nav__item--nested">
786
787
788 <input class="md-nav__toggle md-toggle" data-md-toggle="__nav_4_3" type="checkbox" id="__nav_4_3" >
789
790 <label class="md-nav__link" for="__nav_4_3">
791 New API
792 <span class="md-nav__icon md-icon"></span>
793 </label>
794 <nav class="md-nav" aria-label="New API" data-md-level="2">
795 <label class="md-nav__title" for="__nav_4_3">
796 <span class="md-nav__icon md-icon"></span>
797 New API
798 </label>
799 <ul class="md-nav__list" data-md-scrollfix>
800
801
802
803
804
805 <li class="md-nav__item">
806 <a href="../../../javascript/new-api_writing-a-module/" class="md-nav__link">
807 Writing a module
808 </a>
809 </li>
810
811
812
813
814
815
816
817 <li class="md-nav__item">
818 <a href="../../../javascript/new-api_data-structures/" class="md-nav__link">
819 Data Structures
820 </a>
821 </li>
822
823
824
825
826
827
828
829 <li class="md-nav__item">
830 <a href="../../../javascript/new-api_core/" class="md-nav__link">
831 Core Functions
832 </a>
833 </li>
834
835
836
837
838
839
840
841 <li class="md-nav__item">
842 <a href="../../../javascript/new-api_dom/" class="md-nav__link">
843 DOM
844 </a>
845 </li>
846
847
848
849
850
851
852
853 <li class="md-nav__item">
854 <a href="../../../javascript/new-api_events/" class="md-nav__link">
855 Event Handling
856 </a>
857 </li>
858
859
860
861
862
863
864
865 <li class="md-nav__item">
866 <a href="../../../javascript/new-api_ajax/" class="md-nav__link">
867 Ajax
868 </a>
869 </li>
870
871
872
873
874
875
876
877 <li class="md-nav__item">
878 <a href="../../../javascript/new-api_dialogs/" class="md-nav__link">
879 Dialogs
880 </a>
881 </li>
882
883
884
885
886
887
888
889 <li class="md-nav__item">
890 <a href="../../../javascript/new-api_browser/" class="md-nav__link">
891 Browser and Screen Sizes
892 </a>
893 </li>
894
895
896
897
898
899
900
901 <li class="md-nav__item">
902 <a href="../../../javascript/new-api_ui/" class="md-nav__link">
903 User Interface
904 </a>
905 </li>
906
907
908
909 </ul>
910 </nav>
911 </li>
912
913
914
915
916
917
918
919 <li class="md-nav__item">
920 <a href="../../../javascript/legacy-api/" class="md-nav__link">
921 Legacy API
922 </a>
923 </li>
924
925
926
927
928
929
930
931 <li class="md-nav__item">
932 <a href="../../../javascript/helper-functions/" class="md-nav__link">
933 Helper Functions
934 </a>
935 </li>
936
937
938
939
940
941
942
943 <li class="md-nav__item">
944 <a href="../../../javascript/code-snippets/" class="md-nav__link">
945 Code Snippets
946 </a>
947 </li>
948
949
950
951 </ul>
952 </nav>
953 </li>
954
955
956
957
958
959
960
961
962
963
964
965 <li class="md-nav__item md-nav__item--nested">
966
967
968 <input class="md-nav__toggle md-toggle" data-md-toggle="__nav_5" type="checkbox" id="__nav_5" >
969
970 <label class="md-nav__link" for="__nav_5">
971 Package Components
972 <span class="md-nav__icon md-icon"></span>
973 </label>
974 <nav class="md-nav" aria-label="Package Components" data-md-level="1">
975 <label class="md-nav__title" for="__nav_5">
976 <span class="md-nav__icon md-icon"></span>
977 Package Components
978 </label>
979 <ul class="md-nav__list" data-md-scrollfix>
980
981
982
983
984
985 <li class="md-nav__item">
986 <a href="../../../package/package-xml/" class="md-nav__link">
987 package.xml
988 </a>
989 </li>
990
991
992
993
994
995
996
997
998 <li class="md-nav__item md-nav__item--nested">
999
1000
1001 <input class="md-nav__toggle md-toggle" data-md-toggle="__nav_5_2" type="checkbox" id="__nav_5_2" >
1002
1003 <label class="md-nav__link" for="__nav_5_2">
1004 PIPs
1005 <span class="md-nav__icon md-icon"></span>
1006 </label>
1007 <nav class="md-nav" aria-label="PIPs" data-md-level="2">
1008 <label class="md-nav__title" for="__nav_5_2">
1009 <span class="md-nav__icon md-icon"></span>
1010 PIPs
1011 </label>
1012 <ul class="md-nav__list" data-md-scrollfix>
1013
1014
1015
1016
1017
1018 <li class="md-nav__item">
1019 <a href="../../../package/pip/" class="md-nav__link">
1020 Overview
1021 </a>
1022 </li>
1023
1024
1025
1026
1027
1028
1029
1030 <li class="md-nav__item">
1031 <a href="../../../package/pip/acl-option/" class="md-nav__link">
1032 aclOption
1033 </a>
1034 </li>
1035
1036
1037
1038
1039
1040
1041
1042 <li class="md-nav__item">
1043 <a href="../../../package/pip/acp-menu/" class="md-nav__link">
1044 acpMenu
1045 </a>
1046 </li>
1047
1048
1049
1050
1051
1052
1053
1054 <li class="md-nav__item">
1055 <a href="../../../package/pip/acp-search-provider/" class="md-nav__link">
1056 acpSearchProvider
1057 </a>
1058 </li>
1059
1060
1061
1062
1063
1064
1065
1066 <li class="md-nav__item">
1067 <a href="../../../package/pip/acp-template/" class="md-nav__link">
1068 acpTemplate
1069 </a>
1070 </li>
1071
1072
1073
1074
1075
1076
1077
1078 <li class="md-nav__item">
1079 <a href="../../../package/pip/bbcode/" class="md-nav__link">
1080 bbcode
1081 </a>
1082 </li>
1083
1084
1085
1086
1087
1088
1089
1090 <li class="md-nav__item">
1091 <a href="../../../package/pip/box/" class="md-nav__link">
1092 box
1093 </a>
1094 </li>
1095
1096
1097
1098
1099
1100
1101
1102 <li class="md-nav__item">
1103 <a href="../../../package/pip/clipboard-action/" class="md-nav__link">
1104 clipboardAction
1105 </a>
1106 </li>
1107
1108
1109
1110
1111
1112
1113
1114 <li class="md-nav__item">
1115 <a href="../../../package/pip/core-object/" class="md-nav__link">
1116 coreObject
1117 </a>
1118 </li>
1119
1120
1121
1122
1123
1124
1125
1126 <li class="md-nav__item">
1127 <a href="../../../package/pip/cronjob/" class="md-nav__link">
1128 cronjob
1129 </a>
1130 </li>
1131
1132
1133
1134
1135
1136
1137
1138 <li class="md-nav__item">
1139 <a href="../../../package/pip/database/" class="md-nav__link">
1140 database
1141 </a>
1142 </li>
1143
1144
1145
1146
1147
1148
1149
1150 <li class="md-nav__item">
1151 <a href="../../../package/pip/event-listener/" class="md-nav__link">
1152 eventListener
1153 </a>
1154 </li>
1155
1156
1157
1158
1159
1160
1161
1162 <li class="md-nav__item">
1163 <a href="../../../package/pip/file/" class="md-nav__link">
1164 file
1165 </a>
1166 </li>
1167
1168
1169
1170
1171
1172
1173
1174 <li class="md-nav__item">
1175 <a href="../../../package/pip/language/" class="md-nav__link">
1176 language
1177 </a>
1178 </li>
1179
1180
1181
1182
1183
1184
1185
1186 <li class="md-nav__item">
1187 <a href="../../../package/pip/media-provider/" class="md-nav__link">
1188 mediaProvider
1189 </a>
1190 </li>
1191
1192
1193
1194
1195
1196
1197
1198 <li class="md-nav__item">
1199 <a href="../../../package/pip/menu/" class="md-nav__link">
1200 menu
1201 </a>
1202 </li>
1203
1204
1205
1206
1207
1208
1209
1210 <li class="md-nav__item">
1211 <a href="../../../package/pip/menu-item/" class="md-nav__link">
1212 menuItem
1213 </a>
1214 </li>
1215
1216
1217
1218
1219
1220
1221
1222 <li class="md-nav__item">
1223 <a href="../../../package/pip/object-type/" class="md-nav__link">
1224 objectType
1225 </a>
1226 </li>
1227
1228
1229
1230
1231
1232
1233
1234 <li class="md-nav__item">
1235 <a href="../../../package/pip/object-type-definition/" class="md-nav__link">
1236 objectTypeDefinition
1237 </a>
1238 </li>
1239
1240
1241
1242
1243
1244
1245
1246 <li class="md-nav__item">
1247 <a href="../../../package/pip/option/" class="md-nav__link">
1248 option
1249 </a>
1250 </li>
1251
1252
1253
1254
1255
1256
1257
1258 <li class="md-nav__item">
1259 <a href="../../../package/pip/page/" class="md-nav__link">
1260 page
1261 </a>
1262 </li>
1263
1264
1265
1266
1267
1268
1269
1270 <li class="md-nav__item">
1271 <a href="../../../package/pip/pip/" class="md-nav__link">
1272 pip
1273 </a>
1274 </li>
1275
1276
1277
1278
1279
1280
1281
1282 <li class="md-nav__item">
1283 <a href="../../../package/pip/script/" class="md-nav__link">
1284 script
1285 </a>
1286 </li>
1287
1288
1289
1290
1291
1292
1293
1294 <li class="md-nav__item">
1295 <a href="../../../package/pip/smiley/" class="md-nav__link">
1296 smiley
1297 </a>
1298 </li>
1299
1300
1301
1302
1303
1304
1305
1306 <li class="md-nav__item">
1307 <a href="../../../package/pip/sql/" class="md-nav__link">
1308 sql
1309 </a>
1310 </li>
1311
1312
1313
1314
1315
1316
1317
1318 <li class="md-nav__item">
1319 <a href="../../../package/pip/style/" class="md-nav__link">
1320 style
1321 </a>
1322 </li>
1323
1324
1325
1326
1327
1328
1329
1330 <li class="md-nav__item">
1331 <a href="../../../package/pip/template/" class="md-nav__link">
1332 template
1333 </a>
1334 </li>
1335
1336
1337
1338
1339
1340
1341
1342 <li class="md-nav__item">
1343 <a href="../../../package/pip/template-listener/" class="md-nav__link">
1344 templateListener
1345 </a>
1346 </li>
1347
1348
1349
1350
1351
1352
1353
1354 <li class="md-nav__item">
1355 <a href="../../../package/pip/user-group-option/" class="md-nav__link">
1356 userGroupOption
1357 </a>
1358 </li>
1359
1360
1361
1362
1363
1364
1365
1366 <li class="md-nav__item">
1367 <a href="../../../package/pip/user-menu/" class="md-nav__link">
1368 userMenu
1369 </a>
1370 </li>
1371
1372
1373
1374
1375
1376
1377
1378 <li class="md-nav__item">
1379 <a href="../../../package/pip/user-notification-event/" class="md-nav__link">
1380 userNotificationEvent
1381 </a>
1382 </li>
1383
1384
1385
1386
1387
1388
1389
1390 <li class="md-nav__item">
1391 <a href="../../../package/pip/user-option/" class="md-nav__link">
1392 userOption
1393 </a>
1394 </li>
1395
1396
1397
1398
1399
1400
1401
1402 <li class="md-nav__item">
1403 <a href="../../../package/pip/user-profile-menu/" class="md-nav__link">
1404 userProfileMenu
1405 </a>
1406 </li>
1407
1408
1409
1410 </ul>
1411 </nav>
1412 </li>
1413
1414
1415
1416
1417
1418
1419
1420 <li class="md-nav__item">
1421 <a href="../../../package/database-php-api/" class="md-nav__link">
1422 Database PHP API
1423 </a>
1424 </li>
1425
1426
1427
1428 </ul>
1429 </nav>
1430 </li>
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442 <li class="md-nav__item md-nav__item--nested">
1443
1444
1445 <input class="md-nav__toggle md-toggle" data-md-toggle="__nav_6" type="checkbox" id="__nav_6" >
1446
1447 <label class="md-nav__link" for="__nav_6">
1448 Migration
1449 <span class="md-nav__icon md-icon"></span>
1450 </label>
1451 <nav class="md-nav" aria-label="Migration" data-md-level="1">
1452 <label class="md-nav__title" for="__nav_6">
1453 <span class="md-nav__icon md-icon"></span>
1454 Migration
1455 </label>
1456 <ul class="md-nav__list" data-md-scrollfix>
1457
1458
1459
1460
1461
1462
1463 <li class="md-nav__item md-nav__item--nested">
1464
1465
1466 <input class="md-nav__toggle md-toggle" data-md-toggle="__nav_6_1" type="checkbox" id="__nav_6_1" >
1467
1468 <label class="md-nav__link" for="__nav_6_1">
1469 Migrating from WSC 5.3
1470 <span class="md-nav__icon md-icon"></span>
1471 </label>
1472 <nav class="md-nav" aria-label="Migrating from WSC 5.3" data-md-level="2">
1473 <label class="md-nav__title" for="__nav_6_1">
1474 <span class="md-nav__icon md-icon"></span>
1475 Migrating from WSC 5.3
1476 </label>
1477 <ul class="md-nav__list" data-md-scrollfix>
1478
1479
1480
1481
1482
1483 <li class="md-nav__item">
1484 <a href="../../../migration/wsc53/php/" class="md-nav__link">
1485 PHP API
1486 </a>
1487 </li>
1488
1489
1490
1491
1492
1493
1494
1495 <li class="md-nav__item">
1496 <a href="../../../migration/wsc53/session/" class="md-nav__link">
1497 Session Handling and Authentication
1498 </a>
1499 </li>
1500
1501
1502
1503
1504
1505
1506
1507 <li class="md-nav__item">
1508 <a href="../../../migration/wsc53/javascript/" class="md-nav__link">
1509 TypeScript and JavaScript
1510 </a>
1511 </li>
1512
1513
1514
1515
1516
1517
1518
1519 <li class="md-nav__item">
1520 <a href="../../../migration/wsc53/templates/" class="md-nav__link">
1521 Templates
1522 </a>
1523 </li>
1524
1525
1526
1527
1528
1529
1530
1531 <li class="md-nav__item">
1532 <a href="../../../migration/wsc53/libraries/" class="md-nav__link">
1533 Third Party Libraries
1534 </a>
1535 </li>
1536
1537
1538
1539 </ul>
1540 </nav>
1541 </li>
1542
1543
1544
1545
1546
1547
1548
1549
1550 <li class="md-nav__item md-nav__item--nested">
1551
1552
1553 <input class="md-nav__toggle md-toggle" data-md-toggle="__nav_6_2" type="checkbox" id="__nav_6_2" >
1554
1555 <label class="md-nav__link" for="__nav_6_2">
1556 Migrating from WSC 5.2
1557 <span class="md-nav__icon md-icon"></span>
1558 </label>
1559 <nav class="md-nav" aria-label="Migrating from WSC 5.2" data-md-level="2">
1560 <label class="md-nav__title" for="__nav_6_2">
1561 <span class="md-nav__icon md-icon"></span>
1562 Migrating from WSC 5.2
1563 </label>
1564 <ul class="md-nav__list" data-md-scrollfix>
1565
1566
1567
1568
1569
1570 <li class="md-nav__item">
1571 <a href="../../../migration/wsc52/php/" class="md-nav__link">
1572 PHP API
1573 </a>
1574 </li>
1575
1576
1577
1578
1579
1580
1581
1582 <li class="md-nav__item">
1583 <a href="../../../migration/wsc52/templates/" class="md-nav__link">
1584 Templates and Languages
1585 </a>
1586 </li>
1587
1588
1589
1590
1591
1592
1593
1594 <li class="md-nav__item">
1595 <a href="../../../migration/wsc52/libraries/" class="md-nav__link">
1596 Third Party Libraries
1597 </a>
1598 </li>
1599
1600
1601
1602 </ul>
1603 </nav>
1604 </li>
1605
1606
1607
1608
1609
1610
1611
1612
1613 <li class="md-nav__item md-nav__item--nested">
1614
1615
1616 <input class="md-nav__toggle md-toggle" data-md-toggle="__nav_6_3" type="checkbox" id="__nav_6_3" >
1617
1618 <label class="md-nav__link" for="__nav_6_3">
1619 Migrating from WSC 3.1
1620 <span class="md-nav__icon md-icon"></span>
1621 </label>
1622 <nav class="md-nav" aria-label="Migrating from WSC 3.1" data-md-level="2">
1623 <label class="md-nav__title" for="__nav_6_3">
1624 <span class="md-nav__icon md-icon"></span>
1625 Migrating from WSC 3.1
1626 </label>
1627 <ul class="md-nav__list" data-md-scrollfix>
1628
1629
1630
1631
1632
1633 <li class="md-nav__item">
1634 <a href="../../../migration/wsc31/php/" class="md-nav__link">
1635 PHP API
1636 </a>
1637 </li>
1638
1639
1640
1641 </ul>
1642 </nav>
1643 </li>
1644
1645
1646
1647
1648
1649
1650
1651
1652 <li class="md-nav__item md-nav__item--nested">
1653
1654
1655 <input class="md-nav__toggle md-toggle" data-md-toggle="__nav_6_4" type="checkbox" id="__nav_6_4" >
1656
1657 <label class="md-nav__link" for="__nav_6_4">
1658 Migrating from WSC 3.0
1659 <span class="md-nav__icon md-icon"></span>
1660 </label>
1661 <nav class="md-nav" aria-label="Migrating from WSC 3.0" data-md-level="2">
1662 <label class="md-nav__title" for="__nav_6_4">
1663 <span class="md-nav__icon md-icon"></span>
1664 Migrating from WSC 3.0
1665 </label>
1666 <ul class="md-nav__list" data-md-scrollfix>
1667
1668
1669
1670
1671
1672 <li class="md-nav__item">
1673 <a href="../../../migration/wsc30/php/" class="md-nav__link">
1674 PHP API
1675 </a>
1676 </li>
1677
1678
1679
1680
1681
1682
1683
1684 <li class="md-nav__item">
1685 <a href="../../../migration/wsc30/javascript/" class="md-nav__link">
1686 JavaScript API
1687 </a>
1688 </li>
1689
1690
1691
1692
1693
1694
1695
1696 <li class="md-nav__item">
1697 <a href="../../../migration/wsc30/templates/" class="md-nav__link">
1698 Templates
1699 </a>
1700 </li>
1701
1702
1703
1704
1705
1706
1707
1708 <li class="md-nav__item">
1709 <a href="../../../migration/wsc30/css/" class="md-nav__link">
1710 CSS
1711 </a>
1712 </li>
1713
1714
1715
1716
1717
1718
1719
1720 <li class="md-nav__item">
1721 <a href="../../../migration/wsc30/package/" class="md-nav__link">
1722 Package Components
1723 </a>
1724 </li>
1725
1726
1727
1728 </ul>
1729 </nav>
1730 </li>
1731
1732
1733
1734
1735
1736
1737
1738
1739 <li class="md-nav__item md-nav__item--nested">
1740
1741
1742 <input class="md-nav__toggle md-toggle" data-md-toggle="__nav_6_5" type="checkbox" id="__nav_6_5" >
1743
1744 <label class="md-nav__link" for="__nav_6_5">
1745 Migrating from WCF 2.1
1746 <span class="md-nav__icon md-icon"></span>
1747 </label>
1748 <nav class="md-nav" aria-label="Migrating from WCF 2.1" data-md-level="2">
1749 <label class="md-nav__title" for="__nav_6_5">
1750 <span class="md-nav__icon md-icon"></span>
1751 Migrating from WCF 2.1
1752 </label>
1753 <ul class="md-nav__list" data-md-scrollfix>
1754
1755
1756
1757
1758
1759 <li class="md-nav__item">
1760 <a href="../../../migration/wcf21/php/" class="md-nav__link">
1761 PHP API
1762 </a>
1763 </li>
1764
1765
1766
1767
1768
1769
1770
1771 <li class="md-nav__item">
1772 <a href="../../../migration/wcf21/templates/" class="md-nav__link">
1773 Templates
1774 </a>
1775 </li>
1776
1777
1778
1779
1780
1781
1782
1783 <li class="md-nav__item">
1784 <a href="../../../migration/wcf21/css/" class="md-nav__link">
1785 CSS
1786 </a>
1787 </li>
1788
1789
1790
1791
1792
1793
1794
1795 <li class="md-nav__item">
1796 <a href="../../../migration/wcf21/package/" class="md-nav__link">
1797 Package Components
1798 </a>
1799 </li>
1800
1801
1802
1803 </ul>
1804 </nav>
1805 </li>
1806
1807
1808
1809 </ul>
1810 </nav>
1811 </li>
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823 <li class="md-nav__item md-nav__item--nested">
1824
1825
1826 <input class="md-nav__toggle md-toggle" data-md-toggle="__nav_7" type="checkbox" id="__nav_7" >
1827
1828 <label class="md-nav__link" for="__nav_7">
1829 Tutorials
1830 <span class="md-nav__icon md-icon"></span>
1831 </label>
1832 <nav class="md-nav" aria-label="Tutorials" data-md-level="1">
1833 <label class="md-nav__title" for="__nav_7">
1834 <span class="md-nav__icon md-icon"></span>
1835 Tutorials
1836 </label>
1837 <ul class="md-nav__list" data-md-scrollfix>
1838
1839
1840
1841
1842
1843
1844 <li class="md-nav__item md-nav__item--nested">
1845
1846
1847 <input class="md-nav__toggle md-toggle" data-md-toggle="__nav_7_1" type="checkbox" id="__nav_7_1" >
1848
1849 <label class="md-nav__link" for="__nav_7_1">
1850 Tutorial Series
1851 <span class="md-nav__icon md-icon"></span>
1852 </label>
1853 <nav class="md-nav" aria-label="Tutorial Series" data-md-level="2">
1854 <label class="md-nav__title" for="__nav_7_1">
1855 <span class="md-nav__icon md-icon"></span>
1856 Tutorial Series
1857 </label>
1858 <ul class="md-nav__list" data-md-scrollfix>
1859
1860
1861
1862
1863
1864 <li class="md-nav__item">
1865 <a href="../../../tutorial/series/overview/" class="md-nav__link">
1866 Overview
1867 </a>
1868 </li>
1869
1870
1871
1872
1873
1874
1875
1876 <li class="md-nav__item">
1877 <a href="../../../tutorial/series/part_1/" class="md-nav__link">
1878 Part 1
1879 </a>
1880 </li>
1881
1882
1883
1884
1885
1886
1887
1888 <li class="md-nav__item">
1889 <a href="../../../tutorial/series/part_2/" class="md-nav__link">
1890 Part 2
1891 </a>
1892 </li>
1893
1894
1895
1896
1897
1898
1899
1900 <li class="md-nav__item">
1901 <a href="../../../tutorial/series/part_3/" class="md-nav__link">
1902 Part 3
1903 </a>
1904 </li>
1905
1906
1907
1908
1909
1910
1911
1912 <li class="md-nav__item">
1913 <a href="../../../tutorial/series/part_4/" class="md-nav__link">
1914 Part 4
1915 </a>
1916 </li>
1917
1918
1919
1920
1921
1922
1923
1924 <li class="md-nav__item">
1925 <a href="../../../tutorial/series/part_5/" class="md-nav__link">
1926 Part 5
1927 </a>
1928 </li>
1929
1930
1931
1932 </ul>
1933 </nav>
1934 </li>
1935
1936
1937
1938 </ul>
1939 </nav>
1940 </li>
1941
1942
1943
1944 </ul>
1945 </nav>
1946 </div>
1947 </div>
1948 </div>
1949
1950
1951
1952 <div class="md-sidebar md-sidebar--secondary" data-md-component="sidebar" data-md-type="toc" >
1953 <div class="md-sidebar__scrollwrap">
1954 <div class="md-sidebar__inner">
1955
1956 <nav class="md-nav md-nav--secondary" aria-label="Table of contents">
1957
1958
1959
1960
1961
1962
1963 <label class="md-nav__title" for="__toc">
1964 <span class="md-nav__icon md-icon"></span>
1965 Table of contents
1966 </label>
1967 <ul class="md-nav__list" data-md-component="toc" data-md-scrollfix>
1968
1969 <li class="md-nav__item">
1970 <a href="#objecttypexml" class="md-nav__link">
1971 objectType.xml
1972 </a>
1973
1974 </li>
1975
1976 <li class="md-nav__item">
1977 <a href="#usernotificationeventxml" class="md-nav__link">
1978 userNotificationEvent.xml
1979 </a>
1980
1981 </li>
1982
1983 <li class="md-nav__item">
1984 <a href="#firing-events" class="md-nav__link">
1985 Firing Events
1986 </a>
1987
1988 </li>
1989
1990 <li class="md-nav__item">
1991 <a href="#marking-notifications-as-confirmed" class="md-nav__link">
1992 Marking Notifications as Confirmed
1993 </a>
1994
1995 </li>
1996
1997 </ul>
1998
1999 </nav>
2000 </div>
2001 </div>
2002 </div>
2003
2004
2005 <div class="md-content" data-md-component="content">
2006 <article class="md-content__inner md-typeset">
2007
2008
2009 <a href="https://github.com/WoltLab/docs.woltlab.com/edit/5.4/docs/php/api/user_notifications.md" title="Edit this page" class="md-content__button md-icon">
2010 <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M20.71 7.04c.39-.39.39-1.04 0-1.41l-2.34-2.34c-.37-.39-1.02-.39-1.41 0l-1.84 1.83 3.75 3.75M3 17.25V21h3.75L17.81 9.93l-3.75-3.75L3 17.25z"/></svg>
2011 </a>
2012
2013
2014 <h1 id="user-notifications">User Notifications<a class="headerlink" href="#user-notifications" title="Permanent link">#</a></h1>
2015 <p>WoltLab Suite includes a powerful user notification system that supports notifications directly shown on the website and emails sent immediately or on a daily basis.</p>
2016 <h2 id="objecttypexml"><code>objectType.xml</code><a class="headerlink" href="#objecttypexml" title="Permanent link">#</a></h2>
2017 <p>For any type of object related to events, you have to define an object type for the object type definition <code>com.woltlab.wcf.notification.objectType</code>:</p>
2018 <div class="titledCodeBox">
2019 <div class="codeBoxTitle">
2020 <code>xml</code>
2021 <a class="codeBoxTitleGitHubLink" href="https://github.com/WoltLab/docs.woltlab.com/tree/5.4/snippets/objectType.xml" title="View on GitHub"><span class="twemoji"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7a5 5 0 0 0-5 5 5 5 0 0 0 5 5h4v-1.9H7c-1.71 0-3.1-1.39-3.1-3.1M8 13h8v-2H8v2m9-6h-4v1.9h4c1.71 0 3.1 1.39 3.1 3.1 0 1.71-1.39 3.1-3.1 3.1h-4V17h4a5 5 0 0 0 5-5 5 5 0 0 0-5-5z"/></svg></span></a>
2022 </div>
2023 ```php/api/user_notifications/objectType.xml
2024 ```
2025 </div>
2026
2027 <p>The referenced class <code>FooUserNotificationObjectType</code> has to implement the <a href="https://github.com/WoltLab/WCF/blob/master/wcfsetup/install/files/lib/system/user/notification/object/type/IUserNotificationObjectType.class.php">IUserNotificationObjectType</a> interface, which should be done by extending <a href="https://github.com/WoltLab/WCF/blob/master/wcfsetup/install/files/lib/system/user/notification/object/type/AbstractUserNotificationObjectType.class.php">AbstractUserNotificationObjectType</a>.</p>
2028 <div class="titledCodeBox">
2029 <div class="codeBoxTitle">
2030 <code>php</code>
2031 <a class="codeBoxTitleGitHubLink" href="https://github.com/WoltLab/docs.woltlab.com/tree/5.4/snippets/files/lib/system/user/notification/object/type/FooUserNotificationObjectType.class.php" title="View on GitHub"><span class="twemoji"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7a5 5 0 0 0-5 5 5 5 0 0 0 5 5h4v-1.9H7c-1.71 0-3.1-1.39-3.1-3.1M8 13h8v-2H8v2m9-6h-4v1.9h4c1.71 0 3.1 1.39 3.1 3.1 0 1.71-1.39 3.1-3.1 3.1h-4V17h4a5 5 0 0 0 5-5 5 5 0 0 0-5-5z"/></svg></span></a>
2032 </div>
2033 ```php/api/user_notifications/FooUserNotificationObjectType.class.php
2034 ```
2035 </div>
2036
2037 <p>You have to set the class names of the database object (<code>$objectClassName</code>) and the related list (<code>$objectListClassName</code>).
2038 Additionally, you have to create a class that implements the <a href="https://github.com/WoltLab/WCF/blob/master/wcfsetup/install/files/lib/system/user/notification/object/IUserNotificationObject.class.php">IUserNotificationObject</a> whose name you have to set as the value of the <code>$decoratorClassName</code> property.</p>
2039 <div class="titledCodeBox">
2040 <div class="codeBoxTitle">
2041 <code>php</code>
2042 <a class="codeBoxTitleGitHubLink" href="https://github.com/WoltLab/docs.woltlab.com/tree/5.4/snippets/files/lib/system/user/notification/object/FooUserNotificationObject.class.php" title="View on GitHub"><span class="twemoji"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7a5 5 0 0 0-5 5 5 5 0 0 0 5 5h4v-1.9H7c-1.71 0-3.1-1.39-3.1-3.1M8 13h8v-2H8v2m9-6h-4v1.9h4c1.71 0 3.1 1.39 3.1 3.1 0 1.71-1.39 3.1-3.1 3.1h-4V17h4a5 5 0 0 0 5-5 5 5 0 0 0-5-5z"/></svg></span></a>
2043 </div>
2044 ```php/api/user_notifications/FooUserNotificationObject.class.php
2045 ```
2046 </div>
2047
2048 <ul>
2049 <li>The <code>getTitle()</code> method returns the title of the object.
2050 In this case, we assume that the <code>Foo</code> class has implemented the <a href="https://github.com/WoltLab/WCF/blob/master/wcfsetup/install/files/lib/data/ITitledObject.class.php">ITitledObject</a> interface so that the decorated <code>Foo</code> can handle this method call itself.</li>
2051 <li>The <code>getURL()</code> method returns the link to the object.
2052 As for the <code>getTitle()</code>, we assume that the <code>Foo</code> class has implemented the <a href="https://github.com/WoltLab/WCF/blob/master/wcfsetup/install/files/lib/data/ILinkableObject.class.php">ILinkableObject</a> interface so that the decorated <code>Foo</code> can also handle this method call itself.</li>
2053 <li>The <code>getAuthorID()</code> method returns the id of the user who created the decorated <code>Foo</code> object.
2054 We assume that <code>Foo</code> objects have a <code>userID</code> property that contains this id.</li>
2055 </ul>
2056 <h2 id="usernotificationeventxml"><code>userNotificationEvent.xml</code><a class="headerlink" href="#usernotificationeventxml" title="Permanent link">#</a></h2>
2057 <p>Each event that you fire in your package needs to be registered using the <a href="../../../package/pip/user-notification-event/">user notification event package installation plugin</a>.
2058 An example file might look like this:</p>
2059 <div class="titledCodeBox">
2060 <div class="codeBoxTitle">
2061 <code>xml</code>
2062 <a class="codeBoxTitleGitHubLink" href="https://github.com/WoltLab/docs.woltlab.com/tree/5.4/snippets/userNotificationEvent.xml" title="View on GitHub"><span class="twemoji"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7a5 5 0 0 0-5 5 5 5 0 0 0 5 5h4v-1.9H7c-1.71 0-3.1-1.39-3.1-3.1M8 13h8v-2H8v2m9-6h-4v1.9h4c1.71 0 3.1 1.39 3.1 3.1 0 1.71-1.39 3.1-3.1 3.1h-4V17h4a5 5 0 0 0 5-5 5 5 0 0 0-5-5z"/></svg></span></a>
2063 </div>
2064 ```php/api/user_notifications/userNotificationEvent.xml
2065 ```
2066 </div>
2067
2068 <p>Here, you reference the user notification object type created via <code>objectType.xml</code>.
2069 The referenced class in the <code>&lt;classname&gt;</code> element has to implement the <a href="https://github.com/WoltLab/WCF/blob/master/wcfsetup/install/files/lib/system/user/notification/event/IUserNotificationEvent.class.php">IUserNotificationEvent</a> interface by extending the <a href="https://github.com/WoltLab/WCF/blob/master/wcfsetup/install/files/lib/system/user/notification/event/AbstractUserNotificationEvent.class.php">AbstractUserNotificationEvent</a> class or the <a href="https://github.com/WoltLab/WCF/blob/master/wcfsetup/install/files/lib/system/user/notification/event/AbstractSharedUserNotificationEvent.class.php">AbstractSharedUserNotificationEvent</a> class if you want to pre-load additional data before processing notifications.
2070 In <code>AbstractSharedUserNotificationEvent::prepare()</code>, you can, for example, tell runtime caches to prepare to load certain objects which then are loaded all at once when the objects are needed.</p>
2071 <div class="titledCodeBox">
2072 <div class="codeBoxTitle">
2073 <code>php</code>
2074 <a class="codeBoxTitleGitHubLink" href="https://github.com/WoltLab/docs.woltlab.com/tree/5.4/snippets/files/lib/system/user/notification/event/FooUserNotificationEvent.class.php" title="View on GitHub"><span class="twemoji"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7a5 5 0 0 0-5 5 5 5 0 0 0 5 5h4v-1.9H7c-1.71 0-3.1-1.39-3.1-3.1M8 13h8v-2H8v2m9-6h-4v1.9h4c1.71 0 3.1 1.39 3.1 3.1 0 1.71-1.39 3.1-3.1 3.1h-4V17h4a5 5 0 0 0 5-5 5 5 0 0 0-5-5z"/></svg></span></a>
2075 </div>
2076 ```php/api/user_notifications/FooUserNotificationEvent.class.php
2077 ```
2078 </div>
2079
2080 <ul>
2081 <li>The <code>$stackable</code> property is <code>false</code> by default and has to be explicitly set to <code>true</code> if stacking of notifications should be enabled.
2082 Stacking of notification does not create new notifications for the same event for a certain object if the related action as been triggered by different users.
2083 For example, if something is liked by one user and then liked again by another user before the recipient of the notification has confirmed it, the existing notification will be amended to include both users who liked the content.
2084 Stacking can thus be used to avoid cluttering the notification list of users.</li>
2085 <li>The <code>checkAccess()</code> method makes sure that the active user still has access to the object related to the notification.
2086 If that is not the case, the user notification system will automatically deleted the user notification based on the return value of the method.
2087 If you have any cached values related to notifications, you should also reset these values here.</li>
2088 <li>The <code>getEmailMessage()</code> method return data to create the instant email or the daily summary email.
2089 For instant emails (<code>$notificationType = 'instant'</code>), you have to return an array like the one shown in the code above with the following components:</li>
2090 <li><code>application</code>:
2091 abbreviation of application</li>
2092 <li><code>in-reply-to</code> (optional):
2093 message id of the notification for the parent item and used to improve the ordering in threaded email clients</li>
2094 <li><code>message-id</code> (optional):
2095 message id of the notification mail and has to be used in <code>in-reply-to</code> and <code>references</code> for follow up mails</li>
2096 <li><code>references</code> (optional):
2097 all of the message ids of parent items (i.e. recursive in-reply-to)</li>
2098 <li><code>template</code>:
2099 name of the template used to render the email body, should start with <code>email_</code></li>
2100 <li><code>variables</code> (optional):
2101 template variables passed to the email template where they can be accessed via <code>$notificationContent[variables]</code></li>
2102 </ul>
2103 <p>For daily emails (<code>$notificationType = 'daily'</code>), only <code>application</code>, <code>template</code>, and <code>variables</code> are supported.
2104 - The <code>getEmailTitle()</code> returns the title of the instant email sent to the user.
2105 By default, <code>getEmailTitle()</code> simply calls <code>getTitle()</code>.
2106 - The <code>getEventHash()</code> method returns a hash by which user notifications are grouped.
2107 Here, we want to group them not by the actual <code>Foo</code> object but by its parent <code>Baz</code> object and thus overwrite the default implementation provided by <code>AbstractUserNotificationEvent</code>.
2108 - The <code>getLink()</code> returns the link to the <code>Foo</code> object the notification belongs to.
2109 - The <code>getMessage()</code> method and the <code>getTitle()</code> return the message and the title of the user notification respectively.
2110 By checking the value of <code>count($this-&gt;getAuthors())</code>, we check if the notification is stacked, thus if the event has been triggered for multiple users so that different languages items are used.
2111 If your notification event does not support stacking, this distinction is not necessary.
2112 - The <code>prepare()</code> method is called for each user notification before all user notifications are rendered.
2113 This allows to tell runtime caches to prepare to load objects later on (see <a href="../caches_runtime-caches/">Runtime Caches</a>).</p>
2114 <h2 id="firing-events">Firing Events<a class="headerlink" href="#firing-events" title="Permanent link">#</a></h2>
2115 <p>When the action related to a user notification is executed, you can use <code>UserNotificationHandler::fireEvent()</code> to create the notifications:</p>
2116 <table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span></span><span class="normal">1</span>
2117 <span class="normal">2</span>
2118 <span class="normal">3</span>
2119 <span class="normal">4</span>
2120 <span class="normal">5</span>
2121 <span class="normal">6</span>
2122 <span class="normal">7</span></pre></div></td><td class="code"><div class="highlight"><pre><span></span><code><span class="nv">$recipientIDs</span> <span class="o">=</span> <span class="p">[];</span> <span class="c1">// fill with user ids of the recipients of the notification</span>
2123 <span class="nx">UserNotificationHandler</span><span class="o">::</span><span class="na">getInstance</span><span class="p">()</span><span class="o">-&gt;</span><span class="na">fireEvent</span><span class="p">(</span>
2124 <span class="s1">&#39;bar&#39;</span><span class="p">,</span> <span class="c1">// event name</span>
2125 <span class="s1">&#39;com.woltlab.example.foo&#39;</span><span class="p">,</span> <span class="c1">// event object type name</span>
2126 <span class="k">new</span> <span class="nx">FooUserNotificationObject</span><span class="p">(</span><span class="k">new</span> <span class="nx">Foo</span><span class="p">(</span><span class="nv">$fooID</span><span class="p">)),</span> <span class="c1">// object related to the event</span>
2127 <span class="nv">$recipientIDs</span>
2128 <span class="p">);</span>
2129 </code></pre></div>
2130 </td></tr></table>
2131 <h2 id="marking-notifications-as-confirmed">Marking Notifications as Confirmed<a class="headerlink" href="#marking-notifications-as-confirmed" title="Permanent link">#</a></h2>
2132 <p>In some instances, you might want to manually mark user notifications as confirmed without the user manually confirming them, for example when they visit the page that is related to the user notification.
2133 In this case, you can use <code>UserNotificationHandler::markAsConfirmed()</code>:</p>
2134 <table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span></span><span class="normal">1</span>
2135 <span class="normal">2</span>
2136 <span class="normal">3</span>
2137 <span class="normal">4</span>
2138 <span class="normal">5</span>
2139 <span class="normal">6</span>
2140 <span class="normal">7</span>
2141 <span class="normal">8</span></pre></div></td><td class="code"><div class="highlight"><pre><span></span><code><span class="nv">$recipientIDs</span> <span class="o">=</span> <span class="p">[];</span> <span class="c1">// fill with user ids of the recipients of the notification</span>
2142 <span class="nv">$fooIDs</span> <span class="o">=</span> <span class="p">[];</span> <span class="c1">// fill with ids of related foo objects</span>
2143 <span class="nx">UserNotificationHandler</span><span class="o">::</span><span class="na">getInstance</span><span class="p">()</span><span class="o">-&gt;</span><span class="na">markAsConfirmed</span><span class="p">(</span>
2144 <span class="s1">&#39;bar&#39;</span><span class="p">,</span> <span class="c1">// event name</span>
2145 <span class="s1">&#39;com.woltlab.example.foo&#39;</span><span class="p">,</span> <span class="c1">// event object type name</span>
2146 <span class="nv">$recipientIDs</span><span class="p">,</span>
2147 <span class="nv">$fooIDs</span>
2148 <span class="p">);</span>
2149 </code></pre></div>
2150 </td></tr></table>
2151
2152
2153
2154
2155 <hr>
2156 <div class="md-source-date">
2157 <small>
2158
2159 Last update: 2021-04-23
2160
2161 </small>
2162 </div>
2163
2164
2165
2166
2167
2168
2169
2170
2171 </article>
2172 </div>
2173 </div>
2174
2175 </main>
2176
2177
2178 <footer class="md-footer">
2179
2180 <nav class="md-footer__inner md-grid" aria-label="Footer">
2181
2182 <a href="../user_activity_points/" class="md-footer__link md-footer__link--prev" rel="prev">
2183 <div class="md-footer__button md-icon">
2184 <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M20 11v2H8l5.5 5.5-1.42 1.42L4.16 12l7.92-7.92L13.5 5.5 8 11h12z"/></svg>
2185 </div>
2186 <div class="md-footer__title">
2187 <div class="md-ellipsis">
2188 <span class="md-footer__direction">
2189 Previous
2190 </span>
2191 User Activity Points
2192 </div>
2193 </div>
2194 </a>
2195
2196
2197 <a href="../sitemaps/" class="md-footer__link md-footer__link--next" rel="next">
2198 <div class="md-footer__title">
2199 <div class="md-ellipsis">
2200 <span class="md-footer__direction">
2201 Next
2202 </span>
2203 Sitemaps
2204 </div>
2205 </div>
2206 <div class="md-footer__button md-icon">
2207 <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M4 11v2h12l-5.5 5.5 1.42 1.42L19.84 12l-7.92-7.92L10.5 5.5 16 11H4z"/></svg>
2208 </div>
2209 </a>
2210
2211 </nav>
2212
2213 <div class="md-footer-meta md-typeset">
2214 <div class="md-footer-meta__inner md-grid">
2215 <div class="md-footer-copyright">
2216
2217 <div class="md-footer-copyright__highlight">
2218 Copyright © 2020 WoltLab GmbH
2219 </div>
2220
2221 Made with
2222 <a href="https://squidfunk.github.io/mkdocs-material/" target="_blank" rel="noopener">
2223 Material for MkDocs
2224 </a>
2225
2226 </div>
2227 <div class="md-footer-copyright">
2228 <a href="https://www.woltlab.com/legal-notice/">Legal Notice</a>
2229 <a href="https://www.woltlab.com/privacy-policy/">Privacy Policy</a>
2230 </div>
2231 </div>
2232 </div>
2233 </footer>
2234
2235 </div>
2236 <div class="md-dialog" data-md-component="dialog">
2237 <div class="md-dialog__inner md-typeset"></div>
2238 </div>
2239 <script id="__config" type="application/json">{"base": "../../..", "features": [], "translations": {"clipboard.copy": "Copy to clipboard", "clipboard.copied": "Copied to clipboard", "search.config.lang": "en", "search.config.pipeline": "trimmer, stopWordFilter", "search.config.separator": "[\\s\\-]+", "search.placeholder": "Search", "search.result.placeholder": "Type to start searching", "search.result.none": "No matching documents", "search.result.one": "1 matching document", "search.result.other": "# matching documents", "search.result.more.one": "1 more on this page", "search.result.more.other": "# more on this page", "search.result.term.missing": "Missing"}, "search": "../../../assets/javascripts/workers/search.fe42c31b.min.js", "version": {"provider": "mike"}}</script>
2240
2241
2242 <script src="../../../assets/javascripts/bundle.4ea5477f.min.js"></script>
2243
2244
2245 </body>
2246 </html>