Skip to content

Commit 9e15a70

Browse files
authored
Add configuration for CC addresses in Contact Form (#1777)
This is a necessity in part because the `@smrealms.de` mailbox is overwhelmed with spam. But even if it weren't, this would allow for more prompt responses to submissions (e.g. CC'ing a personal email address that is monitored much more frequently than the official mailbox).
1 parent 3093336 commit 9e15a70

File tree

3 files changed

+12
-0
lines changed

3 files changed

+12
-0
lines changed

config/config.specific.sample.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,9 @@
3131
// E-mail addresses to receive bug reports
3232
const BUG_REPORT_TO_ADDRESSES = [];
3333

34+
// E-mail addresses to CC on contact form submissions
35+
const CONTACT_FORM_CC_ADDRESSES = [];
36+
3437
//const HISTORY_DATABASES = [
3538
// 'smr_classic_history' => 'old_account_id',
3639
// 'smr_12_history' => 'old_account_id2',

phpstan.neon.dist

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ parameters:
2424

2525
dynamicConstantNames:
2626
- BUG_REPORT_TO_ADDRESSES
27+
- CONTACT_FORM_CC_ADDRESSES
2728
- ENABLE_BETA
2829
- ENABLE_DEBUG
2930
- ENABLE_LIBXML_ERRORS
@@ -92,6 +93,11 @@ parameters:
9293
paths:
9394
- src/bootstrap.php
9495
- src/pages/Account/BugReportProcessor.php
96+
-
97+
# https://github.com/phpstan/phpstan/issues/7520
98+
message: '#Empty array passed to foreach.#'
99+
path: src/pages/Account/ContactFormProcessor.php
100+
count: 1
95101
-
96102
# https://github.com/thephpleague/oauth2-client/issues/897
97103
message: '#Parameter \#1 \$token of method .*::getResourceOwner\(\) expects .*AccessToken, .*AccessTokenInterface given.#'

src/pages/Account/ContactFormProcessor.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,9 @@ public function build(Account $account): never {
2222
'Account ID:' . EOL . '-----------' . EOL . $account->getAccountID() . EOL . EOL .
2323
'Message:' . EOL . '------------' . EOL . $msg;
2424
$mail->addAddress($receiver);
25+
foreach (CONTACT_FORM_CC_ADDRESSES as $ccAddress) {
26+
$mail->addCC($ccAddress);
27+
}
2528
$mail->send();
2629

2730
$message = 'Your message has been successfully submitted!';

0 commit comments

Comments
 (0)