This commit is contained in:
James Cole
2023-06-11 16:12:13 +02:00
parent 5318082467
commit 3aa7fe47de
7 changed files with 236 additions and 107 deletions

View File

@@ -744,23 +744,23 @@
}, },
{ {
"name": "symfony/console", "name": "symfony/console",
"version": "v6.2.11", "version": "v6.3.0",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/symfony/console.git", "url": "https://github.com/symfony/console.git",
"reference": "5aa03db8ef0a5457c316ec580e69562d97734c77" "reference": "8788808b07cf0bdd6e4b7fdd23d8ddb1470c83b7"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/symfony/console/zipball/5aa03db8ef0a5457c316ec580e69562d97734c77", "url": "https://api.github.com/repos/symfony/console/zipball/8788808b07cf0bdd6e4b7fdd23d8ddb1470c83b7",
"reference": "5aa03db8ef0a5457c316ec580e69562d97734c77", "reference": "8788808b07cf0bdd6e4b7fdd23d8ddb1470c83b7",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
"php": ">=8.1", "php": ">=8.1",
"symfony/deprecation-contracts": "^2.1|^3", "symfony/deprecation-contracts": "^2.5|^3",
"symfony/polyfill-mbstring": "~1.0", "symfony/polyfill-mbstring": "~1.0",
"symfony/service-contracts": "^1.1|^2|^3", "symfony/service-contracts": "^2.5|^3",
"symfony/string": "^5.4|^6.0" "symfony/string": "^5.4|^6.0"
}, },
"conflict": { "conflict": {
@@ -782,12 +782,6 @@
"symfony/process": "^5.4|^6.0", "symfony/process": "^5.4|^6.0",
"symfony/var-dumper": "^5.4|^6.0" "symfony/var-dumper": "^5.4|^6.0"
}, },
"suggest": {
"psr/log": "For using the console logger",
"symfony/event-dispatcher": "",
"symfony/lock": "",
"symfony/process": ""
},
"type": "library", "type": "library",
"autoload": { "autoload": {
"psr-4": { "psr-4": {
@@ -820,7 +814,7 @@
"terminal" "terminal"
], ],
"support": { "support": {
"source": "https://github.com/symfony/console/tree/v6.2.11" "source": "https://github.com/symfony/console/tree/v6.3.0"
}, },
"funding": [ "funding": [
{ {
@@ -836,20 +830,20 @@
"type": "tidelift" "type": "tidelift"
} }
], ],
"time": "2023-05-26T08:16:21+00:00" "time": "2023-05-29T12:49:39+00:00"
}, },
{ {
"name": "symfony/deprecation-contracts", "name": "symfony/deprecation-contracts",
"version": "v3.2.1", "version": "v3.3.0",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/symfony/deprecation-contracts.git", "url": "https://github.com/symfony/deprecation-contracts.git",
"reference": "e2d1534420bd723d0ef5aec58a22c5fe60ce6f5e" "reference": "7c3aff79d10325257a001fcf92d991f24fc967cf"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/e2d1534420bd723d0ef5aec58a22c5fe60ce6f5e", "url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/7c3aff79d10325257a001fcf92d991f24fc967cf",
"reference": "e2d1534420bd723d0ef5aec58a22c5fe60ce6f5e", "reference": "7c3aff79d10325257a001fcf92d991f24fc967cf",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@@ -858,7 +852,7 @@
"type": "library", "type": "library",
"extra": { "extra": {
"branch-alias": { "branch-alias": {
"dev-main": "3.3-dev" "dev-main": "3.4-dev"
}, },
"thanks": { "thanks": {
"name": "symfony/contracts", "name": "symfony/contracts",
@@ -887,7 +881,7 @@
"description": "A generic function and convention to trigger deprecation notices", "description": "A generic function and convention to trigger deprecation notices",
"homepage": "https://symfony.com", "homepage": "https://symfony.com",
"support": { "support": {
"source": "https://github.com/symfony/deprecation-contracts/tree/v3.2.1" "source": "https://github.com/symfony/deprecation-contracts/tree/v3.3.0"
}, },
"funding": [ "funding": [
{ {
@@ -903,28 +897,29 @@
"type": "tidelift" "type": "tidelift"
} }
], ],
"time": "2023-03-01T10:25:55+00:00" "time": "2023-05-23T14:45:45+00:00"
}, },
{ {
"name": "symfony/event-dispatcher", "name": "symfony/event-dispatcher",
"version": "v6.2.8", "version": "v6.3.0",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/symfony/event-dispatcher.git", "url": "https://github.com/symfony/event-dispatcher.git",
"reference": "04046f35fd7d72f9646e721fc2ecb8f9c67d3339" "reference": "3af8ac1a3f98f6dbc55e10ae59c9e44bfc38dfaa"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/04046f35fd7d72f9646e721fc2ecb8f9c67d3339", "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/3af8ac1a3f98f6dbc55e10ae59c9e44bfc38dfaa",
"reference": "04046f35fd7d72f9646e721fc2ecb8f9c67d3339", "reference": "3af8ac1a3f98f6dbc55e10ae59c9e44bfc38dfaa",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
"php": ">=8.1", "php": ">=8.1",
"symfony/event-dispatcher-contracts": "^2|^3" "symfony/event-dispatcher-contracts": "^2.5|^3"
}, },
"conflict": { "conflict": {
"symfony/dependency-injection": "<5.4" "symfony/dependency-injection": "<5.4",
"symfony/service-contracts": "<2.5"
}, },
"provide": { "provide": {
"psr/event-dispatcher-implementation": "1.0", "psr/event-dispatcher-implementation": "1.0",
@@ -937,13 +932,9 @@
"symfony/error-handler": "^5.4|^6.0", "symfony/error-handler": "^5.4|^6.0",
"symfony/expression-language": "^5.4|^6.0", "symfony/expression-language": "^5.4|^6.0",
"symfony/http-foundation": "^5.4|^6.0", "symfony/http-foundation": "^5.4|^6.0",
"symfony/service-contracts": "^1.1|^2|^3", "symfony/service-contracts": "^2.5|^3",
"symfony/stopwatch": "^5.4|^6.0" "symfony/stopwatch": "^5.4|^6.0"
}, },
"suggest": {
"symfony/dependency-injection": "",
"symfony/http-kernel": ""
},
"type": "library", "type": "library",
"autoload": { "autoload": {
"psr-4": { "psr-4": {
@@ -970,7 +961,7 @@
"description": "Provides tools that allow your application components to communicate with each other by dispatching events and listening to them", "description": "Provides tools that allow your application components to communicate with each other by dispatching events and listening to them",
"homepage": "https://symfony.com", "homepage": "https://symfony.com",
"support": { "support": {
"source": "https://github.com/symfony/event-dispatcher/tree/v6.2.8" "source": "https://github.com/symfony/event-dispatcher/tree/v6.3.0"
}, },
"funding": [ "funding": [
{ {
@@ -986,33 +977,30 @@
"type": "tidelift" "type": "tidelift"
} }
], ],
"time": "2023-03-20T16:06:02+00:00" "time": "2023-04-21T14:41:17+00:00"
}, },
{ {
"name": "symfony/event-dispatcher-contracts", "name": "symfony/event-dispatcher-contracts",
"version": "v3.2.1", "version": "v3.3.0",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/symfony/event-dispatcher-contracts.git", "url": "https://github.com/symfony/event-dispatcher-contracts.git",
"reference": "0ad3b6f1e4e2da5690fefe075cd53a238646d8dd" "reference": "a76aed96a42d2b521153fb382d418e30d18b59df"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/symfony/event-dispatcher-contracts/zipball/0ad3b6f1e4e2da5690fefe075cd53a238646d8dd", "url": "https://api.github.com/repos/symfony/event-dispatcher-contracts/zipball/a76aed96a42d2b521153fb382d418e30d18b59df",
"reference": "0ad3b6f1e4e2da5690fefe075cd53a238646d8dd", "reference": "a76aed96a42d2b521153fb382d418e30d18b59df",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
"php": ">=8.1", "php": ">=8.1",
"psr/event-dispatcher": "^1" "psr/event-dispatcher": "^1"
}, },
"suggest": {
"symfony/event-dispatcher-implementation": ""
},
"type": "library", "type": "library",
"extra": { "extra": {
"branch-alias": { "branch-alias": {
"dev-main": "3.3-dev" "dev-main": "3.4-dev"
}, },
"thanks": { "thanks": {
"name": "symfony/contracts", "name": "symfony/contracts",
@@ -1049,7 +1037,7 @@
"standards" "standards"
], ],
"support": { "support": {
"source": "https://github.com/symfony/event-dispatcher-contracts/tree/v3.2.1" "source": "https://github.com/symfony/event-dispatcher-contracts/tree/v3.3.0"
}, },
"funding": [ "funding": [
{ {
@@ -1065,20 +1053,20 @@
"type": "tidelift" "type": "tidelift"
} }
], ],
"time": "2023-03-01T10:32:47+00:00" "time": "2023-05-23T14:45:45+00:00"
}, },
{ {
"name": "symfony/filesystem", "name": "symfony/filesystem",
"version": "v6.2.10", "version": "v6.3.0",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/symfony/filesystem.git", "url": "https://github.com/symfony/filesystem.git",
"reference": "fd588debf7d1bc16a2c84b4b3b71145d9946b894" "reference": "97b698e1d77d356304def77a8d0cd73090b359ea"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/symfony/filesystem/zipball/fd588debf7d1bc16a2c84b4b3b71145d9946b894", "url": "https://api.github.com/repos/symfony/filesystem/zipball/97b698e1d77d356304def77a8d0cd73090b359ea",
"reference": "fd588debf7d1bc16a2c84b4b3b71145d9946b894", "reference": "97b698e1d77d356304def77a8d0cd73090b359ea",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@@ -1112,7 +1100,7 @@
"description": "Provides basic utilities for the filesystem", "description": "Provides basic utilities for the filesystem",
"homepage": "https://symfony.com", "homepage": "https://symfony.com",
"support": { "support": {
"source": "https://github.com/symfony/filesystem/tree/v6.2.10" "source": "https://github.com/symfony/filesystem/tree/v6.3.0"
}, },
"funding": [ "funding": [
{ {
@@ -1128,20 +1116,20 @@
"type": "tidelift" "type": "tidelift"
} }
], ],
"time": "2023-04-18T13:46:08+00:00" "time": "2023-05-30T17:12:32+00:00"
}, },
{ {
"name": "symfony/finder", "name": "symfony/finder",
"version": "v6.2.7", "version": "v6.3.0",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/symfony/finder.git", "url": "https://github.com/symfony/finder.git",
"reference": "20808dc6631aecafbe67c186af5dcb370be3a0eb" "reference": "d9b01ba073c44cef617c7907ce2419f8d00d75e2"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/symfony/finder/zipball/20808dc6631aecafbe67c186af5dcb370be3a0eb", "url": "https://api.github.com/repos/symfony/finder/zipball/d9b01ba073c44cef617c7907ce2419f8d00d75e2",
"reference": "20808dc6631aecafbe67c186af5dcb370be3a0eb", "reference": "d9b01ba073c44cef617c7907ce2419f8d00d75e2",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@@ -1176,7 +1164,7 @@
"description": "Finds files and directories via an intuitive fluent interface", "description": "Finds files and directories via an intuitive fluent interface",
"homepage": "https://symfony.com", "homepage": "https://symfony.com",
"support": { "support": {
"source": "https://github.com/symfony/finder/tree/v6.2.7" "source": "https://github.com/symfony/finder/tree/v6.3.0"
}, },
"funding": [ "funding": [
{ {
@@ -1192,25 +1180,25 @@
"type": "tidelift" "type": "tidelift"
} }
], ],
"time": "2023-02-16T09:57:23+00:00" "time": "2023-04-02T01:25:41+00:00"
}, },
{ {
"name": "symfony/options-resolver", "name": "symfony/options-resolver",
"version": "v6.2.7", "version": "v6.3.0",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/symfony/options-resolver.git", "url": "https://github.com/symfony/options-resolver.git",
"reference": "aa0e85b53bbb2b4951960efd61d295907eacd629" "reference": "a10f19f5198d589d5c33333cffe98dc9820332dd"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/symfony/options-resolver/zipball/aa0e85b53bbb2b4951960efd61d295907eacd629", "url": "https://api.github.com/repos/symfony/options-resolver/zipball/a10f19f5198d589d5c33333cffe98dc9820332dd",
"reference": "aa0e85b53bbb2b4951960efd61d295907eacd629", "reference": "a10f19f5198d589d5c33333cffe98dc9820332dd",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
"php": ">=8.1", "php": ">=8.1",
"symfony/deprecation-contracts": "^2.1|^3" "symfony/deprecation-contracts": "^2.5|^3"
}, },
"type": "library", "type": "library",
"autoload": { "autoload": {
@@ -1243,7 +1231,7 @@
"options" "options"
], ],
"support": { "support": {
"source": "https://github.com/symfony/options-resolver/tree/v6.2.7" "source": "https://github.com/symfony/options-resolver/tree/v6.3.0"
}, },
"funding": [ "funding": [
{ {
@@ -1259,7 +1247,7 @@
"type": "tidelift" "type": "tidelift"
} }
], ],
"time": "2023-02-14T08:44:56+00:00" "time": "2023-05-12T14:21:09+00:00"
}, },
{ {
"name": "symfony/polyfill-ctype", "name": "symfony/polyfill-ctype",
@@ -1755,16 +1743,16 @@
}, },
{ {
"name": "symfony/process", "name": "symfony/process",
"version": "v6.2.11", "version": "v6.3.0",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/symfony/process.git", "url": "https://github.com/symfony/process.git",
"reference": "97ae9721bead9d1a39b5650e2f4b7834b93b539c" "reference": "8741e3ed7fe2e91ec099e02446fb86667a0f1628"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/symfony/process/zipball/97ae9721bead9d1a39b5650e2f4b7834b93b539c", "url": "https://api.github.com/repos/symfony/process/zipball/8741e3ed7fe2e91ec099e02446fb86667a0f1628",
"reference": "97ae9721bead9d1a39b5650e2f4b7834b93b539c", "reference": "8741e3ed7fe2e91ec099e02446fb86667a0f1628",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@@ -1796,7 +1784,7 @@
"description": "Executes commands in sub-processes", "description": "Executes commands in sub-processes",
"homepage": "https://symfony.com", "homepage": "https://symfony.com",
"support": { "support": {
"source": "https://github.com/symfony/process/tree/v6.2.11" "source": "https://github.com/symfony/process/tree/v6.3.0"
}, },
"funding": [ "funding": [
{ {
@@ -1812,20 +1800,20 @@
"type": "tidelift" "type": "tidelift"
} }
], ],
"time": "2023-05-19T07:42:48+00:00" "time": "2023-05-19T08:06:44+00:00"
}, },
{ {
"name": "symfony/service-contracts", "name": "symfony/service-contracts",
"version": "v3.2.1", "version": "v3.3.0",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/symfony/service-contracts.git", "url": "https://github.com/symfony/service-contracts.git",
"reference": "a8c9cedf55f314f3a186041d19537303766df09a" "reference": "40da9cc13ec349d9e4966ce18b5fbcd724ab10a4"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/symfony/service-contracts/zipball/a8c9cedf55f314f3a186041d19537303766df09a", "url": "https://api.github.com/repos/symfony/service-contracts/zipball/40da9cc13ec349d9e4966ce18b5fbcd724ab10a4",
"reference": "a8c9cedf55f314f3a186041d19537303766df09a", "reference": "40da9cc13ec349d9e4966ce18b5fbcd724ab10a4",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@@ -1835,13 +1823,10 @@
"conflict": { "conflict": {
"ext-psr": "<1.1|>=2" "ext-psr": "<1.1|>=2"
}, },
"suggest": {
"symfony/service-implementation": ""
},
"type": "library", "type": "library",
"extra": { "extra": {
"branch-alias": { "branch-alias": {
"dev-main": "3.3-dev" "dev-main": "3.4-dev"
}, },
"thanks": { "thanks": {
"name": "symfony/contracts", "name": "symfony/contracts",
@@ -1881,7 +1866,7 @@
"standards" "standards"
], ],
"support": { "support": {
"source": "https://github.com/symfony/service-contracts/tree/v3.2.1" "source": "https://github.com/symfony/service-contracts/tree/v3.3.0"
}, },
"funding": [ "funding": [
{ {
@@ -1897,25 +1882,25 @@
"type": "tidelift" "type": "tidelift"
} }
], ],
"time": "2023-03-01T10:32:47+00:00" "time": "2023-05-23T14:45:45+00:00"
}, },
{ {
"name": "symfony/stopwatch", "name": "symfony/stopwatch",
"version": "v6.2.7", "version": "v6.3.0",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/symfony/stopwatch.git", "url": "https://github.com/symfony/stopwatch.git",
"reference": "f3adc98c1061875dd2edcd45e5b04e63d0e29f8f" "reference": "fc47f1015ec80927ff64ba9094dfe8b9d48fe9f2"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/symfony/stopwatch/zipball/f3adc98c1061875dd2edcd45e5b04e63d0e29f8f", "url": "https://api.github.com/repos/symfony/stopwatch/zipball/fc47f1015ec80927ff64ba9094dfe8b9d48fe9f2",
"reference": "f3adc98c1061875dd2edcd45e5b04e63d0e29f8f", "reference": "fc47f1015ec80927ff64ba9094dfe8b9d48fe9f2",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
"php": ">=8.1", "php": ">=8.1",
"symfony/service-contracts": "^1|^2|^3" "symfony/service-contracts": "^2.5|^3"
}, },
"type": "library", "type": "library",
"autoload": { "autoload": {
@@ -1943,7 +1928,7 @@
"description": "Provides a way to profile code", "description": "Provides a way to profile code",
"homepage": "https://symfony.com", "homepage": "https://symfony.com",
"support": { "support": {
"source": "https://github.com/symfony/stopwatch/tree/v6.2.7" "source": "https://github.com/symfony/stopwatch/tree/v6.3.0"
}, },
"funding": [ "funding": [
{ {
@@ -1959,20 +1944,20 @@
"type": "tidelift" "type": "tidelift"
} }
], ],
"time": "2023-02-14T08:44:56+00:00" "time": "2023-02-16T10:14:28+00:00"
}, },
{ {
"name": "symfony/string", "name": "symfony/string",
"version": "v6.2.8", "version": "v6.3.0",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/symfony/string.git", "url": "https://github.com/symfony/string.git",
"reference": "193e83bbd6617d6b2151c37fff10fa7168ebddef" "reference": "f2e190ee75ff0f5eced645ec0be5c66fac81f51f"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/symfony/string/zipball/193e83bbd6617d6b2151c37fff10fa7168ebddef", "url": "https://api.github.com/repos/symfony/string/zipball/f2e190ee75ff0f5eced645ec0be5c66fac81f51f",
"reference": "193e83bbd6617d6b2151c37fff10fa7168ebddef", "reference": "f2e190ee75ff0f5eced645ec0be5c66fac81f51f",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@@ -1983,13 +1968,13 @@
"symfony/polyfill-mbstring": "~1.0" "symfony/polyfill-mbstring": "~1.0"
}, },
"conflict": { "conflict": {
"symfony/translation-contracts": "<2.0" "symfony/translation-contracts": "<2.5"
}, },
"require-dev": { "require-dev": {
"symfony/error-handler": "^5.4|^6.0", "symfony/error-handler": "^5.4|^6.0",
"symfony/http-client": "^5.4|^6.0", "symfony/http-client": "^5.4|^6.0",
"symfony/intl": "^6.2", "symfony/intl": "^6.2",
"symfony/translation-contracts": "^2.0|^3.0", "symfony/translation-contracts": "^2.5|^3.0",
"symfony/var-exporter": "^5.4|^6.0" "symfony/var-exporter": "^5.4|^6.0"
}, },
"type": "library", "type": "library",
@@ -2029,7 +2014,7 @@
"utf8" "utf8"
], ],
"support": { "support": {
"source": "https://github.com/symfony/string/tree/v6.2.8" "source": "https://github.com/symfony/string/tree/v6.3.0"
}, },
"funding": [ "funding": [
{ {
@@ -2045,7 +2030,7 @@
"type": "tidelift" "type": "tidelift"
} }
], ],
"time": "2023-03-20T16:06:02+00:00" "time": "2023-03-21T21:06:29+00:00"
} }
], ],
"packages-dev": [], "packages-dev": [],

View File

@@ -23,6 +23,7 @@ declare(strict_types=1);
namespace FireflyIII\Handlers\Events; namespace FireflyIII\Handlers\Events;
use Exception;
use FireflyIII\Exceptions\FireflyException; use FireflyIII\Exceptions\FireflyException;
use FireflyIII\Notifications\User\NewAccessToken; use FireflyIII\Notifications\User\NewAccessToken;
use FireflyIII\Repositories\User\UserRepositoryInterface; use FireflyIII\Repositories\User\UserRepositoryInterface;
@@ -50,7 +51,21 @@ class APIEventHandler
$user = $repository->find((int)$event->userId); $user = $repository->find((int)$event->userId);
if (null !== $user) { if (null !== $user) {
Notification::send($user, new NewAccessToken()); try {
Notification::send($user, new NewAccessToken());
} catch (Exception $e) {
$message = $e->getMessage();
if (str_contains($message, 'Bcc')) {
Log::warning('[Bcc] Could not send notification. Please validate your email settings, use the .env.example file as a guide.');
return;
}
if (str_contains($message, 'RFC 2822')) {
Log::warning('[RFC] Could not send notification. Please validate your email settings, use the .env.example file as a guide.');
return;
}
Log::error($e->getMessage());
Log::error($e->getTraceAsString());
}
} }
} }
} }

View File

@@ -23,6 +23,7 @@ declare(strict_types=1);
namespace FireflyIII\Handlers\Events; namespace FireflyIII\Handlers\Events;
use Exception;
use FireflyIII\Events\Admin\InvitationCreated; use FireflyIII\Events\Admin\InvitationCreated;
use FireflyIII\Events\AdminRequestedTestMessage; use FireflyIII\Events\AdminRequestedTestMessage;
use FireflyIII\Events\NewVersionAvailable; use FireflyIII\Events\NewVersionAvailable;
@@ -31,6 +32,7 @@ use FireflyIII\Notifications\Admin\UserInvitation;
use FireflyIII\Notifications\Admin\VersionCheckResult; use FireflyIII\Notifications\Admin\VersionCheckResult;
use FireflyIII\Repositories\User\UserRepositoryInterface; use FireflyIII\Repositories\User\UserRepositoryInterface;
use FireflyIII\Support\Facades\FireflyConfig; use FireflyIII\Support\Facades\FireflyConfig;
use Illuminate\Support\Facades\Log;
use Illuminate\Support\Facades\Notification; use Illuminate\Support\Facades\Notification;
/** /**
@@ -54,7 +56,21 @@ class AdminEventHandler
$all = $repository->all(); $all = $repository->all();
foreach ($all as $user) { foreach ($all as $user) {
if ($repository->hasRole($user, 'owner')) { if ($repository->hasRole($user, 'owner')) {
Notification::send($user, new UserInvitation($event->invitee)); try {
Notification::send($user, new UserInvitation($event->invitee));
} catch (Exception $e) {
$message = $e->getMessage();
if (str_contains($message, 'Bcc')) {
Log::warning('[Bcc] Could not send notification. Please validate your email settings, use the .env.example file as a guide.');
return;
}
if (str_contains($message, 'RFC 2822')) {
Log::warning('[RFC] Could not send notification. Please validate your email settings, use the .env.example file as a guide.');
return;
}
Log::error($e->getMessage());
Log::error($e->getTraceAsString());
}
} }
} }
} }
@@ -77,7 +93,21 @@ class AdminEventHandler
$all = $repository->all(); $all = $repository->all();
foreach ($all as $user) { foreach ($all as $user) {
if ($repository->hasRole($user, 'owner')) { if ($repository->hasRole($user, 'owner')) {
Notification::send($user, new VersionCheckResult($event->message)); try {
Notification::send($user, new VersionCheckResult($event->message));
} catch (Exception $e) {
$message = $e->getMessage();
if (str_contains($message, 'Bcc')) {
Log::warning('[Bcc] Could not send notification. Please validate your email settings, use the .env.example file as a guide.');
return;
}
if (str_contains($message, 'RFC 2822')) {
Log::warning('[RFC] Could not send notification. Please validate your email settings, use the .env.example file as a guide.');
return;
}
Log::error($e->getMessage());
Log::error($e->getTraceAsString());
}
} }
} }
} }
@@ -97,7 +127,20 @@ class AdminEventHandler
if (!$repository->hasRole($event->user, 'owner')) { if (!$repository->hasRole($event->user, 'owner')) {
return; return;
} }
try {
Notification::send($event->user, new TestNotification($event->user->email)); Notification::send($event->user, new TestNotification($event->user->email));
} catch (Exception $e) {
$message = $e->getMessage();
if (str_contains($message, 'Bcc')) {
Log::warning('[Bcc] Could not send notification. Please validate your email settings, use the .env.example file as a guide.');
return;
}
if (str_contains($message, 'RFC 2822')) {
Log::warning('[RFC] Could not send notification. Please validate your email settings, use the .env.example file as a guide.');
return;
}
Log::error($e->getMessage());
Log::error($e->getTraceAsString());
}
} }
} }

View File

@@ -23,6 +23,7 @@ declare(strict_types=1);
namespace FireflyIII\Handlers\Events; namespace FireflyIII\Handlers\Events;
use Exception;
use FireflyIII\Events\RequestedReportOnJournals; use FireflyIII\Events\RequestedReportOnJournals;
use FireflyIII\Exceptions\FireflyException; use FireflyIII\Exceptions\FireflyException;
use FireflyIII\Models\TransactionGroup; use FireflyIII\Models\TransactionGroup;
@@ -66,7 +67,20 @@ class AutomationHandler
foreach ($event->groups as $group) { foreach ($event->groups as $group) {
$groups[] = $transformer->transformObject($group); $groups[] = $transformer->transformObject($group);
} }
try {
Notification::send($user, new TransactionCreation($groups)); Notification::send($user, new TransactionCreation($groups));
} catch (Exception $e) {
$message = $e->getMessage();
if (str_contains($message, 'Bcc')) {
Log::warning('[Bcc] Could not send notification. Please validate your email settings, use the .env.example file as a guide.');
return;
}
if (str_contains($message, 'RFC 2822')) {
Log::warning('[RFC] Could not send notification. Please validate your email settings, use the .env.example file as a guide.');
return;
}
Log::error($e->getMessage());
Log::error($e->getTraceAsString());
}
} }
} }

View File

@@ -24,6 +24,7 @@ declare(strict_types=1);
namespace FireflyIII\Handlers\Events; namespace FireflyIII\Handlers\Events;
use Exception;
use FireflyIII\Events\WarnUserAboutBill; use FireflyIII\Events\WarnUserAboutBill;
use FireflyIII\Notifications\User\BillReminder; use FireflyIII\Notifications\User\BillReminder;
use FireflyIII\Support\Facades\Preferences; use FireflyIII\Support\Facades\Preferences;
@@ -49,7 +50,21 @@ class BillEventHandler
if (true === $preference) { if (true === $preference) {
Log::debug('Bill reminder is true!'); Log::debug('Bill reminder is true!');
Notification::send($bill->user, new BillReminder($bill, $event->field, $event->diff)); try {
Notification::send($bill->user, new BillReminder($bill, $event->field, $event->diff));
} catch (Exception $e) {
$message = $e->getMessage();
if (str_contains($message, 'Bcc')) {
Log::warning('[Bcc] Could not send notification. Please validate your email settings, use the .env.example file as a guide.');
return;
}
if (str_contains($message, 'RFC 2822')) {
Log::warning('[RFC] Could not send notification. Please validate your email settings, use the .env.example file as a guide.');
return;
}
Log::error($e->getMessage());
Log::error($e->getTraceAsString());
}
} }
if (false === $preference) { if (false === $preference) {
Log::debug('User has disabled bill reminders.'); Log::debug('User has disabled bill reminders.');

View File

@@ -201,7 +201,21 @@ class UserEventHandler
/** @var array $entry */ /** @var array $entry */
foreach ($list as $index => $entry) { foreach ($list as $index => $entry) {
if (false === $entry['notified']) { if (false === $entry['notified']) {
Notification::send($user, new UserLogin($ipAddress)); try {
Notification::send($user, new UserLogin($ipAddress));
} catch (Exception $e) {
$message = $e->getMessage();
if (str_contains($message, 'Bcc')) {
Log::warning('[Bcc] Could not send notification. Please validate your email settings, use the .env.example file as a guide.');
return;
}
if (str_contains($message, 'RFC 2822')) {
Log::warning('[RFC] Could not send notification. Please validate your email settings, use the .env.example file as a guide.');
return;
}
Log::error($e->getMessage());
Log::error($e->getTraceAsString());
}
} }
$list[$index]['notified'] = true; $list[$index]['notified'] = true;
} }
@@ -221,7 +235,21 @@ class UserEventHandler
$all = $repository->all(); $all = $repository->all();
foreach ($all as $user) { foreach ($all as $user) {
if ($repository->hasRole($user, 'owner')) { if ($repository->hasRole($user, 'owner')) {
Notification::send($user, new AdminRegistrationNotification($event->user)); try {
Notification::send($user, new AdminRegistrationNotification($event->user));
} catch (Exception $e) {
$message = $e->getMessage();
if (str_contains($message, 'Bcc')) {
Log::warning('[Bcc] Could not send notification. Please validate your email settings, use the .env.example file as a guide.');
return;
}
if (str_contains($message, 'RFC 2822')) {
Log::warning('[RFC] Could not send notification. Please validate your email settings, use the .env.example file as a guide.');
return;
}
Log::error($e->getMessage());
Log::error($e->getTraceAsString());
}
} }
} }
} }
@@ -281,7 +309,21 @@ class UserEventHandler
*/ */
public function sendNewPassword(RequestedNewPassword $event): void public function sendNewPassword(RequestedNewPassword $event): void
{ {
Notification::send($event->user, new UserNewPassword(route('password.reset', [$event->token]))); try {
Notification::send($event->user, new UserNewPassword(route('password.reset', [$event->token])));
} catch (Exception $e) {
$message = $e->getMessage();
if (str_contains($message, 'Bcc')) {
Log::warning('[Bcc] Could not send notification. Please validate your email settings, use the .env.example file as a guide.');
return;
}
if (str_contains($message, 'RFC 2822')) {
Log::warning('[RFC] Could not send notification. Please validate your email settings, use the .env.example file as a guide.');
return;
}
Log::error($e->getMessage());
Log::error($e->getTraceAsString());
}
} }
/** /**
@@ -313,7 +355,21 @@ class UserEventHandler
{ {
$sendMail = FireflyConfig::get('notification_user_new_reg', true)->data; $sendMail = FireflyConfig::get('notification_user_new_reg', true)->data;
if ($sendMail) { if ($sendMail) {
Notification::send($event->user, new UserRegistrationNotification()); try {
Notification::send($event->user, new UserRegistrationNotification());
} catch (Exception $e) {
$message = $e->getMessage();
if (str_contains($message, 'Bcc')) {
Log::warning('[Bcc] Could not send notification. Please validate your email settings, use the .env.example file as a guide.');
return;
}
if (str_contains($message, 'RFC 2822')) {
Log::warning('[RFC] Could not send notification. Please validate your email settings, use the .env.example file as a guide.');
return;
}
Log::error($e->getMessage());
Log::error($e->getTraceAsString());
}
} }
} }

View File

@@ -31,6 +31,7 @@ use Illuminate\Queue\InteractsWithQueue;
use Illuminate\Queue\SerializesModels; use Illuminate\Queue\SerializesModels;
use Illuminate\Support\Facades\Log; use Illuminate\Support\Facades\Log;
use Mail; use Mail;
use Symfony\Component\Mailer\Exception\TransportException;
/** /**
* Class MailError. * Class MailError.
@@ -90,7 +91,7 @@ class MailError extends Job implements ShouldQueue
} }
} }
); );
} catch (Exception $e) { // intentional generic exception } catch (Exception|TransportException $e) { // intentional generic exception
$message = $e->getMessage(); $message = $e->getMessage();
if (str_contains($message, 'Bcc')) { if (str_contains($message, 'Bcc')) {
Log::warning('[Bcc] Could not email or log the error. Please validate your email settings, use the .env.example file as a guide.'); Log::warning('[Bcc] Could not email or log the error. Please validate your email settings, use the .env.example file as a guide.');