🎨 Improved getText() to reused and readability

no issue
It easier to modify those messages later without having to search through the entire function body.
It also improves readability by providing clear labels for each piece of text.
In future, sharing constant values throughout project.
This commit is contained in:
Kadam, Sanjeev Kumar 2024-02-17 15:48:38 +05:30
parent 0c4d62880e
commit 228189584f
2 changed files with 22 additions and 16 deletions

View File

@ -52,19 +52,22 @@ class NewslettersService {
return `Verify email address`;
},
getText(url, type, email) {
const expiration_message = 'For your security, the link will expire in 24 hours time.';
const Help_text = 'If you did not make this request, you can simply delete this message. This email address will not be used.';
const From_address = 'Sent to';
return `
Hey there,
Please confirm your email address with this link:
${url}
For your security, the link will expire in 24 hours time.
${expiration_message}
---
Sent to ${email}
If you did not make this request, you can simply delete this message. This email address will not be used.
${From_address} ${email}
${Help_text}
`;
},
getHTML(url, type, email) {

View File

@ -46,19 +46,22 @@ class SettingsBREADService {
return `Verify email address`;
},
getText(url, type, email) {
const expiration_message = 'For your security, the link will expire in 24 hours time.';
const Help_text = 'If you did not make this request, you can simply delete this message. This email address will not be used.';
const From_address = 'Sent to';
return `
Hey there,
Please confirm your email address with this link:
${url}
For your security, the link will expire in 24 hours time.
${expiration_message}
---
Sent to ${email}
If you did not make this request, you can simply delete this message. This email address will not be used.
${From_address} ${email}
${Help_text}
`;
},
getHTML(url, type, email) {