diff --git a/.changeset/chilly-flowers-brake.md b/.changeset/chilly-flowers-brake.md new file mode 100644 index 000000000000..d23c7867cb25 --- /dev/null +++ b/.changeset/chilly-flowers-brake.md @@ -0,0 +1,5 @@ +--- +"@rocket.chat/meteor": major +--- + +Fixed broken translation in "Forgot Password" e-mail diff --git a/apps/meteor/server/startup/migrations/index.ts b/apps/meteor/server/startup/migrations/index.ts index bd17b4618934..2dadd2102360 100644 --- a/apps/meteor/server/startup/migrations/index.ts +++ b/apps/meteor/server/startup/migrations/index.ts @@ -42,5 +42,6 @@ import './v306'; import './v307'; import './v308'; import './v309'; +import './v310'; export * from './xrun'; diff --git a/apps/meteor/server/startup/migrations/v310.ts b/apps/meteor/server/startup/migrations/v310.ts new file mode 100644 index 000000000000..6905b37293d3 --- /dev/null +++ b/apps/meteor/server/startup/migrations/v310.ts @@ -0,0 +1,27 @@ +import type { ISetting } from '@rocket.chat/core-typings'; +import { Settings } from '@rocket.chat/models'; + +import { addMigration } from '../../lib/migrations'; + +addMigration({ + version: 310, + name: 'Update translation key on "Forgot password" e-mail body setting', + async up() { + const forgotPasswordEmail = await Settings.findOneById>('Forgot_Password_Email', { projection: { value: 1 } }); + if (!forgotPasswordEmail) { + return; + } + const newPackageValue = + '

{Forgot_password}

{Lets_get_you_new_one_}

{Reset}

{If_you_didnt_ask_for_reset_ignore_this_email}

'; + + await Settings.updateOne( + { _id: 'Forgot_Password_Email' }, + { + $set: { + packageValue: newPackageValue, + value: (forgotPasswordEmail.value as string).replace(/{Lets_get_you_new_one}/g, '{Lets_get_you_new_one_}'), + }, + }, + ); + }, +});