Skip to content
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

fix: Double signature in composed Email #16178

Merged
merged 5 commits into from
Mar 9, 2022

Conversation

gavindsouza
Copy link
Collaborator

@gavindsouza gavindsouza commented Mar 1, 2022

Quill doesn't deal with HTML for the most part. This means that the comment was being stripped off before it ever reached the backend. I don't know if the <!-- signature-included --> comment ever worked 🥲.

Before

The previous behaviour was to add User's or Email Account's signature via Desk, and if one doesn't exist while processing the Email in the backend add Email Account signature if one exists. Signature added in the backend would not reflect in the Communication or Email Queue records 🥲.

After

The proposed implementation adds a signature (sender's or email account's signature) if one doesn't already exist in the Email content. This behaviour is not triggered when the Email Composer is used via Desk, or via the email.make API.

Re-do of #12520; Undone by #12878

@gavindsouza gavindsouza requested review from a team and hasnain2808 and removed request for a team March 1, 2022 09:15
@codecov
Copy link

codecov bot commented Mar 1, 2022

Codecov Report

Merging #16178 (3858eff) into develop (97f7472) will increase coverage by 4.91%.
The diff coverage is 72.22%.

@@             Coverage Diff             @@
##           develop   #16178      +/-   ##
===========================================
+ Coverage    51.86%   56.77%   +4.91%     
===========================================
  Files          744      756      +12     
  Lines        66193    66847     +654     
  Branches      5555     5703     +148     
===========================================
+ Hits         34329    37954    +3625     
+ Misses       27830    25428    -2402     
+ Partials      4034     3465     -569     
Flag Coverage Δ
server 62.12% <72.22%> (+0.84%) ⬆️
ui-tests 47.12% <ø> (+12.67%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

@gavindsouza gavindsouza marked this pull request as draft March 1, 2022 09:54
@sagarvora
Copy link
Contributor

Don't know how I missed this in #12878 😓

Looks good.

gavindsouza and others added 2 commits March 2, 2022 16:25
Re-do of frappe#12520
Undone by frappe#12878

Changes done to reflect current state of version-13

Co-authored-by: Suraj Shetty <surajshetty3416@gmail.com>
This fix adds a signature forcibly if found under the sender's
User.email_signature or default outgoing email account's signature
field.

The previous method of adding a comment into the Email didn't work since
Quill would discard comments before setting them. Adding signatures in
get_formatted_html didn't seem apt since it's used in QueueBuilder to
re-construct the Email before processing the Email Queue. This meant
that the email content that was added in the Communication record would
not be final. Now, we treat the signature as part of the Communication
content.
@gavindsouza
Copy link
Collaborator Author

Don't know how I missed this in #12878 😓

Looks good.

Seems like this had nothing to do with your PR @sagarvora. At first glance, it did seem so though. The refactor works fine. Sorry about the false alarm.

This is added to handle purposely removed signature or custom signatures
added via the Email Composer or via the email.make API
@gavindsouza gavindsouza marked this pull request as ready for review March 3, 2022 14:36
@gavindsouza
Copy link
Collaborator Author

@Mergifyio backport version-13-hotfix

@mergify
Copy link
Contributor

mergify bot commented Mar 3, 2022

backport version-13-hotfix

🟠 Waiting for conditions to match

  • merged [:pushpin: backport requirement]

@mergify
Copy link
Contributor

mergify bot commented Mar 9, 2022

backport version-13-hotfix

✅ Backports have been created

mergify bot added a commit that referenced this pull request Mar 9, 2022
This is a semi-automatic backport of pull request #16178 done by [Mergify](https://mergify.com).
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 3, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants