Skip to content

Commit 8c8dd72

Browse files
authored
Settings: Bring back notifications (#1333)
1 parent e751086 commit 8c8dd72

File tree

1 file changed

+50
-0
lines changed

1 file changed

+50
-0
lines changed

includes/wp-admin/class-settings-fields.php

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,13 @@ public static function register_settings_fields() {
3737
'activitypub_settings'
3838
);
3939

40+
add_settings_section(
41+
'activitypub_notifications',
42+
__( 'Notifications', 'activitypub' ),
43+
array( self::class, 'render_notifications_section' ),
44+
'activitypub_settings'
45+
);
46+
4047
add_settings_section(
4148
'activitypub_general',
4249
__( 'General', 'activitypub' ),
@@ -153,6 +160,49 @@ public static function register_settings_fields() {
153160
}
154161
}
155162

163+
/**
164+
* Render notifications section.
165+
*/
166+
public static function render_notifications_section() {
167+
?>
168+
<p>
169+
<?php \esc_html_e( 'Choose which notifications you want to receive. The plugin currently only supports e-mail notifications, but we will add more options in the future.', 'activitypub' ); ?>
170+
</p>
171+
<table class="form-table">
172+
<tbody>
173+
<tr>
174+
<th scope="col">
175+
<?php \esc_html_e( 'Type', 'activitypub' ); ?>
176+
</th>
177+
<th scope="col">
178+
<?php \esc_html_e( 'E-Mail', 'activitypub' ); ?>
179+
</th>
180+
</tr>
181+
<tr>
182+
<td>
183+
<?php \esc_html_e( 'New followers', 'activitypub' ); ?>
184+
</td>
185+
<td>
186+
<label>
187+
<input type="checkbox" name="activitypub_mailer_new_follower" id="activitypub_mailer_new_follower" value="1" <?php \checked( '1', \get_option( 'activitypub_mailer_new_follower', '0' ) ); ?> />
188+
</label>
189+
</td>
190+
</tr>
191+
<tr>
192+
<td>
193+
<?php \esc_html_e( 'Direct Messages', 'activitypub' ); ?>
194+
</td>
195+
<td>
196+
<label>
197+
<input type="checkbox" name="activitypub_mailer_new_dm" id="activitypub_mailer_new_dm" value="1" <?php \checked( '1', \get_option( 'activitypub_mailer_new_dm', '0' ) ); ?> />
198+
</label>
199+
</td>
200+
</tr>
201+
</tbody>
202+
</table>
203+
<?php
204+
}
205+
156206
/**
157207
* Render actor mode field.
158208
*/

0 commit comments

Comments
 (0)