Skip to content

Commit 8c2385c

Browse files
authored
Merge pull request #615 from AaronJackson/slack-stuff
Slack stuff
2 parents 8c540d8 + c7c1bfd commit 8c2385c

File tree

9 files changed

+32
-2
lines changed

9 files changed

+32
-2
lines changed

app/HMS/Entities/Role.php

+4
Original file line numberDiff line numberDiff line change
@@ -439,6 +439,10 @@ public function setRetained($retained): self
439439
*/
440440
public function routeNotificationForSlack(): false|string
441441
{
442+
if (! config('hms.features.slack')) {
443+
return false;
444+
}
445+
442446
if ($this->name == self::TEAM_TRUSTEES) {
443447
return config('hms.trustees_slack_webhook', false);
444448
} else {

app/Mail/Membership/MembershipComplete.php

+6
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,11 @@ class MembershipComplete extends Mailable implements ShouldQueue
7171
*/
7272
public $slackHTML;
7373

74+
/**
75+
* @var string
76+
*/
77+
public $discordHTML;
78+
7479
/**
7580
* @var string
7681
*/
@@ -111,6 +116,7 @@ public function __construct(User $user, MetaRepository $metaRepository, RoleRepo
111116
$this->groupLink = $metaRepository->get('google_group_html');
112117
$this->rulesHTML = $metaRepository->get('rules_html');
113118
$this->slackHTML = $metaRepository->get('slack_html');
119+
$this->discordHTML = $metaRepository->get('discord_html');
114120
$this->wikiLink = $metaRepository->get('wiki_html');
115121
$this->gatekeeperSetupGuide = $metaRepository->get('gatekeeper_setup_guide');
116122

app/Mail/Membership/MembershipReinstated.php

+6
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,11 @@ class MembershipReinstated extends Mailable implements ShouldQueue
6565
*/
6666
public $slackHTML;
6767

68+
/**
69+
* @var string
70+
*/
71+
public $discordHTML;
72+
6873
/**
6974
* @var string
7075
*/
@@ -95,6 +100,7 @@ public function __construct(User $user, MetaRepository $metaRepository, RoleRepo
95100
$this->groupLink = $metaRepository->get('google_group_html');
96101
$this->rulesHTML = $metaRepository->get('rules_html');
97102
$this->slackHTML = $metaRepository->get('slack_html');
103+
$this->discordHTML = $metaRepository->get('discord_html');
98104
$this->wikiLink = $metaRepository->get('wiki_html');
99105

100106
$this->membershipTeamEmail = $roleRepository->findOneByName(Role::TEAM_MEMBERSHIP)->getEmail();

config/hms.php

+1
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
'space_api' => env('FEATURE_SPACEAPI', true),
2828
'mw_auth_hms' => env('FEATURE_MW_AUTH_WIKI', true),
2929
'slack' => env('FEATURE_SLACK', false),
30+
'team_slack' => env('FEATURE_SLACK', false) && env('TEAM_SLACK_WEBHOOK', false),
3031
'discord' => env('FEATURE_DISCORD', false),
3132
'roundcube_login' => env('FEATURE_ROUNDCUBE_LOGIN', false) && env('ROUNDCUBE_LOGIN_HELPER_URL', false),
3233
'retention_email' => env('FEATURE_RETENTION_EMAIL', false),

config/meta.php

+1
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@
5252
'self_book_max_length' => 180,
5353
'self_book_min_period_between_bookings' => 720,
5454
'slack_html' => 'http://slack.nottinghack.org.uk',
55+
'discord_html' => 'https://wiki.nottinghack.org.uk/wiki/Discord',
5556
'so_bank_id' => 2,
5657
'temporary_access_email_link' => 'https://wiki.nottinghack.org.uk',
5758
'temporary_access_notification_delay' => 5,

resources/views/emails/membership/membershipComplete.blade.php

+6
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,14 @@
1919
Our Google Group is where a lot of online discussion takes place:
2020
{{ $groupLink }}
2121

22+
@feature('team_slack')
2223
Slack is also used for team discussions. You can join NH teams slack at:
2324
{{ $slackHTML }}
25+
@endfeature
26+
@feature('discord')
27+
Discord is also used for members to chat online. You can join the NH Discord at:
28+
{{ $discordHTML }}
29+
@endfeature
2430

2531
The {{ config('branding.space_type') }} rules:
2632
{{ $rulesHTML }}

resources/views/emails/membership/membershipReinstated.blade.php

+6
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,14 @@
1515
Our Google Group is where a lot of online discussion takes place:
1616
{{ $groupLink }}
1717

18+
@feature('team_slack')
1819
Slack is also used for team discussions. You can join NH teams slack at:
1920
{{ $slackHTML }}
21+
@endfeature
22+
@feature('discord')
23+
Discord is also used for members to chat online. You can join the NH Discord at:
24+
{{ $discordHTML }}
25+
@endfeature
2026

2127
The {{ config('branding.space_type') }} rules:
2228
{{ $rulesHTML }}

resources/views/governance/proxies/designate_link.blade.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
<ol>
2828
<li>Find a fellow member going to the AGM.</li>
2929
<li>Ask them if they will be you Proxy.</li>
30-
<li>Email, Slack or SMS them the link below. Hint click (<button type="button" class="btn btn-light btn-sm" onclick="copyToClipboard('#designate-link')"><i class="far fa-copy"></i></button>) to copy it to your clipboard.</li>
30+
<li>Share the link below to your proxy. Hint click (<button type="button" class="btn btn-light btn-sm" onclick="copyToClipboard('#designate-link')"><i class="far fa-copy"></i></button>) to copy it to your clipboard.</li>
3131
<li>Once your Proxy follows the link and confirms their acceptance you will receive confirmation via email.</li>
3232
</ol>
3333
</p>

resources/views/team/index.blade.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818

1919
<div class="row text-muted">
2020
<div class="col-md-4">Email: {{ $team->getEmail() }}</div>
21-
@feature('slack')
21+
@feature('team_slack')
2222
<div class="col-md-4">Slack: {{ $team->getSlackChannel() }}</div>
2323
@endfeature
2424
@feature('discord')

0 commit comments

Comments
 (0)