Merge pull request #8628 from appwrite/fix-session-alert-copy

Fix: Improve mail datetime format
This commit is contained in:
Christy Jacob 2024-09-05 20:47:20 +04:00 committed by GitHub
commit 52bda3945d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 42 additions and 40 deletions

View file

@ -20,7 +20,7 @@
"emails.magicSession.signature": "{{project}} team", "emails.magicSession.signature": "{{project}} team",
"emails.sessionAlert.subject": "Security alert: new session on your {{project}} account", "emails.sessionAlert.subject": "Security alert: new session on your {{project}} account",
"emails.sessionAlert.hello":"Hello {{user}}", "emails.sessionAlert.hello":"Hello {{user}}",
"emails.sessionAlert.body": "A new session has been created on your {{b}}{{project}}{{/b}} account, on {{b}}{{dateTime}}{{/b}}.\nHere are the details of the new session: ", "emails.sessionAlert.body": "A new session has been created on your {{b}}{{project}}{{/b}} account, {{b}}on {{date}}, {{year}} at {{time}} UTC{{/b}}.\nHere are the details of the new session: ",
"emails.sessionAlert.listDevice": "Device: {{b}}{{device}}{{/b}}", "emails.sessionAlert.listDevice": "Device: {{b}}{{device}}{{/b}}",
"emails.sessionAlert.listIpAddress": "IP Address: {{b}}{{ipAddress}}{{/b}}", "emails.sessionAlert.listIpAddress": "IP Address: {{b}}{{ipAddress}}{{/b}}",
"emails.sessionAlert.listCountry": "Country: {{b}}{{country}}{{/b}}", "emails.sessionAlert.listCountry": "Country: {{b}}{{country}}{{/b}}",

View file

@ -124,7 +124,9 @@ function sendSessionAlert(Locale $locale, Document $user, Document $project, Doc
$emailVariables = [ $emailVariables = [
'direction' => $locale->getText('settings.direction'), 'direction' => $locale->getText('settings.direction'),
'dateTime' => DateTime::format(new \DateTime(), 'h:ia MMMM dS'), 'date' => (new \DateTime())->format('F j'),
'year' => (new \DateTime())->format('YYYY'),
'time' => (new \DateTime())->format('H:i:s'),
'user' => $user->getAttribute('name'), 'user' => $user->getAttribute('name'),
'project' => $project->getAttribute('name'), 'project' => $project->getAttribute('name'),
'device' => $session->getAttribute('clientName'), 'device' => $session->getAttribute('clientName'),

76
composer.lock generated
View file

@ -2599,16 +2599,16 @@
}, },
{ {
"name": "utopia-php/storage", "name": "utopia-php/storage",
"version": "0.18.4", "version": "0.18.5",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/utopia-php/storage.git", "url": "https://github.com/utopia-php/storage.git",
"reference": "94ab8758fabcefee5c5fa723616e45719833f922" "reference": "7d355c5e3ccc8ecebc0266f8ddd30088a43be919"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/utopia-php/storage/zipball/94ab8758fabcefee5c5fa723616e45719833f922", "url": "https://api.github.com/repos/utopia-php/storage/zipball/7d355c5e3ccc8ecebc0266f8ddd30088a43be919",
"reference": "94ab8758fabcefee5c5fa723616e45719833f922", "reference": "7d355c5e3ccc8ecebc0266f8ddd30088a43be919",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -2648,9 +2648,9 @@
], ],
"support": { "support": {
"issues": "https://github.com/utopia-php/storage/issues", "issues": "https://github.com/utopia-php/storage/issues",
"source": "https://github.com/utopia-php/storage/tree/0.18.4" "source": "https://github.com/utopia-php/storage/tree/0.18.5"
}, },
"time": "2024-04-02T08:24:09+00:00" "time": "2024-09-04T08:57:27+00:00"
}, },
{ {
"name": "utopia-php/swoole", "name": "utopia-php/swoole",
@ -3314,16 +3314,16 @@
}, },
{ {
"name": "laravel/pint", "name": "laravel/pint",
"version": "v1.17.2", "version": "v1.17.3",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/laravel/pint.git", "url": "https://github.com/laravel/pint.git",
"reference": "e8a88130a25e3f9d4d5785e6a1afca98268ab110" "reference": "9d77be916e145864f10788bb94531d03e1f7b482"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/laravel/pint/zipball/e8a88130a25e3f9d4d5785e6a1afca98268ab110", "url": "https://api.github.com/repos/laravel/pint/zipball/9d77be916e145864f10788bb94531d03e1f7b482",
"reference": "e8a88130a25e3f9d4d5785e6a1afca98268ab110", "reference": "9d77be916e145864f10788bb94531d03e1f7b482",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -3334,13 +3334,13 @@
"php": "^8.1.0" "php": "^8.1.0"
}, },
"require-dev": { "require-dev": {
"friendsofphp/php-cs-fixer": "^3.61.1", "friendsofphp/php-cs-fixer": "^3.64.0",
"illuminate/view": "^10.48.18", "illuminate/view": "^10.48.20",
"larastan/larastan": "^2.9.8", "larastan/larastan": "^2.9.8",
"laravel-zero/framework": "^10.4.0", "laravel-zero/framework": "^10.4.0",
"mockery/mockery": "^1.6.12", "mockery/mockery": "^1.6.12",
"nunomaduro/termwind": "^1.15.1", "nunomaduro/termwind": "^1.15.1",
"pestphp/pest": "^2.35.0" "pestphp/pest": "^2.35.1"
}, },
"bin": [ "bin": [
"builds/pint" "builds/pint"
@ -3376,7 +3376,7 @@
"issues": "https://github.com/laravel/pint/issues", "issues": "https://github.com/laravel/pint/issues",
"source": "https://github.com/laravel/pint" "source": "https://github.com/laravel/pint"
}, },
"time": "2024-08-06T15:11:54+00:00" "time": "2024-09-03T15:00:28+00:00"
}, },
{ {
"name": "matthiasmullie/minify", "name": "matthiasmullie/minify",
@ -4185,16 +4185,16 @@
}, },
{ {
"name": "phpstan/phpdoc-parser", "name": "phpstan/phpdoc-parser",
"version": "1.29.1", "version": "1.30.0",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/phpstan/phpdoc-parser.git", "url": "https://github.com/phpstan/phpdoc-parser.git",
"reference": "fcaefacf2d5c417e928405b71b400d4ce10daaf4" "reference": "5ceb0e384997db59f38774bf79c2a6134252c08f"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/phpstan/phpdoc-parser/zipball/fcaefacf2d5c417e928405b71b400d4ce10daaf4", "url": "https://api.github.com/repos/phpstan/phpdoc-parser/zipball/5ceb0e384997db59f38774bf79c2a6134252c08f",
"reference": "fcaefacf2d5c417e928405b71b400d4ce10daaf4", "reference": "5ceb0e384997db59f38774bf79c2a6134252c08f",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -4226,9 +4226,9 @@
"description": "PHPDoc parser with support for nullable, intersection and generic types", "description": "PHPDoc parser with support for nullable, intersection and generic types",
"support": { "support": {
"issues": "https://github.com/phpstan/phpdoc-parser/issues", "issues": "https://github.com/phpstan/phpdoc-parser/issues",
"source": "https://github.com/phpstan/phpdoc-parser/tree/1.29.1" "source": "https://github.com/phpstan/phpdoc-parser/tree/1.30.0"
}, },
"time": "2024-05-31T08:52:43+00:00" "time": "2024-08-29T09:54:52+00:00"
}, },
{ {
"name": "phpunit/php-code-coverage", "name": "phpunit/php-code-coverage",
@ -5865,16 +5865,16 @@
}, },
{ {
"name": "symfony/console", "name": "symfony/console",
"version": "v7.1.3", "version": "v7.1.4",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/symfony/console.git", "url": "https://github.com/symfony/console.git",
"reference": "cb1dcb30ebc7005c29864ee78adb47b5fb7c3cd9" "reference": "1eed7af6961d763e7832e874d7f9b21c3ea9c111"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/symfony/console/zipball/cb1dcb30ebc7005c29864ee78adb47b5fb7c3cd9", "url": "https://api.github.com/repos/symfony/console/zipball/1eed7af6961d763e7832e874d7f9b21c3ea9c111",
"reference": "cb1dcb30ebc7005c29864ee78adb47b5fb7c3cd9", "reference": "1eed7af6961d763e7832e874d7f9b21c3ea9c111",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -5938,7 +5938,7 @@
"terminal" "terminal"
], ],
"support": { "support": {
"source": "https://github.com/symfony/console/tree/v7.1.3" "source": "https://github.com/symfony/console/tree/v7.1.4"
}, },
"funding": [ "funding": [
{ {
@ -5954,7 +5954,7 @@
"type": "tidelift" "type": "tidelift"
} }
], ],
"time": "2024-07-26T12:41:01+00:00" "time": "2024-08-15T22:48:53+00:00"
}, },
{ {
"name": "symfony/deprecation-contracts", "name": "symfony/deprecation-contracts",
@ -6091,16 +6091,16 @@
}, },
{ {
"name": "symfony/finder", "name": "symfony/finder",
"version": "v7.1.3", "version": "v7.1.4",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/symfony/finder.git", "url": "https://github.com/symfony/finder.git",
"reference": "717c6329886f32dc65e27461f80f2a465412fdca" "reference": "d95bbf319f7d052082fb7af147e0f835a695e823"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/symfony/finder/zipball/717c6329886f32dc65e27461f80f2a465412fdca", "url": "https://api.github.com/repos/symfony/finder/zipball/d95bbf319f7d052082fb7af147e0f835a695e823",
"reference": "717c6329886f32dc65e27461f80f2a465412fdca", "reference": "d95bbf319f7d052082fb7af147e0f835a695e823",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -6135,7 +6135,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/v7.1.3" "source": "https://github.com/symfony/finder/tree/v7.1.4"
}, },
"funding": [ "funding": [
{ {
@ -6151,7 +6151,7 @@
"type": "tidelift" "type": "tidelift"
} }
], ],
"time": "2024-07-24T07:08:44+00:00" "time": "2024-08-13T14:28:19+00:00"
}, },
{ {
"name": "symfony/options-resolver", "name": "symfony/options-resolver",
@ -6604,16 +6604,16 @@
}, },
{ {
"name": "symfony/string", "name": "symfony/string",
"version": "v7.1.3", "version": "v7.1.4",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/symfony/string.git", "url": "https://github.com/symfony/string.git",
"reference": "ea272a882be7f20cad58d5d78c215001617b7f07" "reference": "6cd670a6d968eaeb1c77c2e76091c45c56bc367b"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/symfony/string/zipball/ea272a882be7f20cad58d5d78c215001617b7f07", "url": "https://api.github.com/repos/symfony/string/zipball/6cd670a6d968eaeb1c77c2e76091c45c56bc367b",
"reference": "ea272a882be7f20cad58d5d78c215001617b7f07", "reference": "6cd670a6d968eaeb1c77c2e76091c45c56bc367b",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -6671,7 +6671,7 @@
"utf8" "utf8"
], ],
"support": { "support": {
"source": "https://github.com/symfony/string/tree/v7.1.3" "source": "https://github.com/symfony/string/tree/v7.1.4"
}, },
"funding": [ "funding": [
{ {
@ -6687,7 +6687,7 @@
"type": "tidelift" "type": "tidelift"
} }
], ],
"time": "2024-07-22T10:25:37+00:00" "time": "2024-08-12T09:59:40+00:00"
}, },
{ {
"name": "textalk/websocket", "name": "textalk/websocket",