-
Notifications
You must be signed in to change notification settings - Fork 46
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Issue 3952 improve text clarity with password protected email #3953
Issue 3952 improve text clarity with password protected email #3953
Conversation
@@ -231,8 +231,8 @@ export class EncryptedMsgMailFormatter extends BaseMailFormatter { | |||
text.push(intro + '\n'); | |||
html.push(Xss.escape(intro).replace(/\n/g, '<br>') + '<br><br>'); | |||
} | |||
text.push(Lang.compose.msgEncryptedText[lang] + msgUrl + '\n\n'); | |||
html.push(`${Lang.compose.msgEncryptedHtml[lang] + a}<br/><br/>${Lang.compose.alternativelyCopyPaste[lang] + Xss.escape(msgUrl)}<br/><br/>`); | |||
text.push(Lang.compose.msgEncryptedText(lang, Xss.escape(this.acctEmail)) + msgUrl + '\n\n'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well, acctEmail
isn't same as senderEmail
(as one account can have aliases, so getSender()
method exists, input_from
visual element appears for such accounts), so we should actually implement and test that the text in the message matches the sender email.
We can copy some of the lines from the test 'standalone - different send from, new signed message, verification in mock' to
- select an alias to send from (@'input-from')
- SettingsPageRecipe.addKeyTest -- not needed
- send -- we can take password sending lines from the test 'compose - PWD encrypted message with flowcrypt.com/api' (file upload is not needed).
- verification of the resulting message text.
Verification actually happens in a different place.
The mock that accepts the sent message usesTestBySubjectStrategyContext
constructor to select an obejct (based on partial text from the message subject) to further test the message.
Soif (subject.includes('PWD encrypted message with flowcrypt.com/api'))
it will get toPwdEncryptedMessageWithFlowCryptComApiTestStrategy
. -- I added a couple of lines there to check that the text matches the sender email -- please pull the change.
So, please implement 3 tests:
compatibility
account, fromflowcrypt.compatibility...
compatibility
account, fromflowcryptcompatibility...
aliasci.tests.gmail
account -- this account doesn't have any aliases, so noinput_from
is visible. Make sure it is handled correctly.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Copy sir, @rrrooommmaaa. Thanks for the very helpful context here. I'll be working on this as soon as possible.
extension/js/common/lang.ts
Outdated
msgEncryptedHtml: { EN: 'This message is encrypted: ', DE: 'Diese Nachricht ist verschlüsselt: ' }, | ||
msgEncryptedText: { EN: 'This message is encrypted. Follow this link to open it: ', DE: 'Diese Nachricht ist verschlüsselt. Nachricht öffnen: ' }, | ||
msgEncryptedHtml: (lang: string, acctEmail: string) => lang === 'EN' ? `${acctEmail} has sent you a password-encrypted email ` : `${acctEmail} hat Ihnen eine passwortverschlüsselte E-Mail gesendet `, | ||
msgEncryptedText: (lang: string, acctEmail: string) => lang === 'EN' ? `${acctEmail} has sent you a password-encrypted email. Follow this link to open it: ` : `${acctEmail} hat Ihnen eine passwortverschlüsselte E-Mail gesendet. Folgen Sie diesem Link, um es zu öffnen `, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually, makes more sense to test lang === 'DE'
, so that all other languages would default to English
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, yes! It should definitely work like that! I'll be working on it. Thank you sir!
…-email' of https://github.com/flowcrypt/flowcrypt-browser into issue-3952-improve-text-clarity-with-password-protected-email
…text-clarity-with-password-protected-email
…text-clarity-with-password-protected-email
sir, @rrrooommmaaa. I was able to follow your given instructions which found helpful as usual. When I tried to get combine it and try to read the sent email by email subject using const sentMsg = (await GoogleData.withInitializedData(senderEmail)).getMessageBySubject(subject)!; From here I'm getting undefined as the returned value. I found out that the function const subject = 'PWD encrypted message with flowcrypt.com/api'; which was later could be use in Thanks in advance. |
There were 1 email addresses found in the above comment. Please:
|
Hi @martgil I think we don't need to extract the sent message like this.
|
…text-clarity-with-password-protected-email
Ah, you're right @rrrooommmaaa. I finally get it now :) Thank you so much!! |
This PR will improve text clarity with password-protected email
close #3952 // if this PR closes an issue
Tests (delete all except exactly one):
To be filled by reviewers
I have reviewed that this PR... (tick whichever items you personally focused on during this review):