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

Update lost password email to use HTML link #31092

Merged
merged 2 commits into from
Apr 16, 2018

Conversation

joeyberkovitz
Copy link
Contributor

Description

Update the lost password email to send both HTML and plain text versions so that URL in email can be clicked.

Related Issue

#30742

Motivation and Context

Solve issue #30742

How Has This Been Tested?

Update associated tests to add HTML support.

Screenshots (if appropriate):

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

@CLAassistant
Copy link

CLAassistant commented Apr 11, 2018

CLA assistant check
All committers have signed the CLA.

@codecov
Copy link

codecov bot commented Apr 11, 2018

Codecov Report

Merging #31092 into master will increase coverage by 0.01%.
The diff coverage is 100%.

Impacted file tree graph

@@             Coverage Diff              @@
##             master   #31092      +/-   ##
============================================
+ Coverage      62.5%   62.52%   +0.01%     
- Complexity    18269    18435     +166     
============================================
  Files          1146     1147       +1     
  Lines         68397    68416      +19     
  Branches       1234     1234              
============================================
+ Hits          42753    42777      +24     
+ Misses        25283    25278       -5     
  Partials        361      361
Flag Coverage Δ Complexity Δ
#javascript 52.03% <ø> (ø) 0 <ø> (ø) ⬇️
#phpunit 63.71% <100%> (+0.01%) 18435 <0> (+166) ⬆️
Impacted Files Coverage Δ Complexity Δ
core/templates/lostpassword/altemail.php 100% <100%> (ø) 0 <0> (?)
core/templates/lostpassword/email.php 100% <100%> (ø) 0 <0> (ø) ⬇️
core/Controller/LostController.php 88.46% <100%> (+0.36%) 32 <0> (ø) ⬇️
lib/private/Log.php 76.13% <0%> (+0.27%) 40% <0%> (+1%) ⬆️
lib/private/NavigationManager.php 88.37% <0%> (+7.35%) 35% <0%> (+2%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 74e4712...5b3c23b. Read the comment docs.

@PVince81
Copy link
Contributor

Thanks a lot for this PR!

Please note that some of these templates are customizable so I'm not sure if relying on "strip_tags" here would fit all scenarios.

A better way would be to use the same approach like for other emails: there are two template files, one called "mail.php" (for HTML) and "altmail.php" (for plain text). So here I suggest to do the same and have "core/templates/lostpassword/email.php" be the HTML email and create a new template "core/templates/lostpassword/altemail.php" with the plain text version.

Then wire this up with the code.

@joeyberkovitz
Copy link
Contributor Author

Sure.
I added a plain text template as you recommended.
I also updated both templates to be consistent with the format of the other email templates.

Copy link
Contributor

@PVince81 PVince81 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested, works 👍

cc @phil-davis @individual-it to include in acceptance tests

@PVince81
Copy link
Contributor

Hmm just noticed an extra ">" at the end of the HTML mail:
image

That one doesn't appear for other mails.

@joeyberkovitz mind verifying the markup ? I had a quick look but wasn't able to spot it

@joeyberkovitz
Copy link
Contributor Author

That's odd because I don't see the ">" in the source or in the email it sends out from my system, which is up to date with the Git repository. I'll try to debug some more later.
owncloud_lost_email

@joeyberkovitz
Copy link
Contributor Author

I cloned the repository into a separate directory and reinstalled Owncloud.
I wasn't able to reproduce the extra ">" using two different SMTP servers.
The only thing I did notice is that since the image is added by URL rather than being included, when mail clients like gmail try to pre-render the image, it'll fail if the URL isn't public. That might be a different issue though because it affects all of the existing email templates.

@PVince81
Copy link
Contributor

Thanks for confirming. Then maybe it was a bug in Mailhog's HTML renderer.

@PVince81 PVince81 merged commit b1be2f8 into owncloud:master Apr 16, 2018
@PVince81
Copy link
Contributor

Mind backporting this to the stable10 branch ? Basically branch off stable10, cherry-pick your commits then submit PR to stable10 after checking it still works.

@joeyberkovitz
Copy link
Contributor Author

I created the backport PR

@phil-davis
Copy link
Contributor

Backport stable10 #31144

@individual-it
Copy link
Member

@paurakhsharma is working on acceptance tests in #31168

@PVince81 PVince81 modified the milestones: development, QA Jun 13, 2018
@lock
Copy link

lock bot commented Jul 31, 2019

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked as resolved and limited conversation to collaborators Jul 31, 2019
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.

5 participants