Skip to content

Commit

Permalink
fix!: "Forgot Password" e-mail is not translated correctly (#32212)
Browse files Browse the repository at this point in the history
* fix: Update translation key used by 'Forgot Password' e-mail body setting

---------

Co-authored-by: Marcos Spessatto Defendi <marcos.defendi@rocket.chat>
  • Loading branch information
2 people authored and ggazzo committed Oct 17, 2024
1 parent b67aa72 commit 02afa10
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .changeset/chilly-flowers-brake.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@rocket.chat/meteor": major
---

Fixed broken translation in "Forgot Password" e-mail
1 change: 1 addition & 0 deletions apps/meteor/server/startup/migrations/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,5 +42,6 @@ import './v306';
import './v307';
import './v308';
import './v309';
import './v310';

export * from './xrun';
27 changes: 27 additions & 0 deletions apps/meteor/server/startup/migrations/v310.ts
Original file line number Diff line number Diff line change
@@ -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<Pick<ISetting, 'value'>>('Forgot_Password_Email', { projection: { value: 1 } });
if (!forgotPasswordEmail) {
return;
}
const newPackageValue =
'<h2>{Forgot_password}</h2><p>{Lets_get_you_new_one_}</p><a class="btn" href="[Forgot_Password_Url]">{Reset}</a><p class="advice">{If_you_didnt_ask_for_reset_ignore_this_email}</p>';

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_}'),
},
},
);
},
});

0 comments on commit 02afa10

Please sign in to comment.