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

New layout for welcome email #4244

Merged
merged 4 commits into from
Apr 7, 2017
Merged

New layout for welcome email #4244

merged 4 commits into from
Apr 7, 2017

Conversation

MorrisJobke
Copy link
Member

@MorrisJobke MorrisJobke commented Apr 6, 2017

bildschirmfoto 2017-04-06 um 13 14 30

bildschirmfoto 2017-04-06 um 13 18 52

@juliushaertl @Espina2 @jancborchardt @LukasReschke @rullzer @tobiasKaminsky For a first feedback

@MorrisJobke MorrisJobke added the 3. to review Waiting for reviews label Apr 6, 2017
@mention-bot
Copy link

@MorrisJobke, thanks for your PR! By analyzing the history of the files in this pull request, we identified @jancborchardt, @eppfel and @rullzer to be potential reviewers.

@MorrisJobke
Copy link
Member Author

There are now also unit tests for this helper. That checks if a working (nearly the same as the example by @Espina2 ) template gets produced.

@MorrisJobke MorrisJobke added 2. developing Work in progress and removed 3. to review Waiting for reviews labels Apr 7, 2017
@MorrisJobke
Copy link
Member Author

@LukasReschke Could you please have a look at the failing unit tests? That would be awesome :)

@Espina2
Copy link
Contributor

Espina2 commented Apr 7, 2017

@MorrisJobke Nice work!!
The last text after the black logo it should be more greyish since is a secondary info.

@LukasReschke
Copy link
Member

LukasReschke commented Apr 7, 2017

Tests should be fixed now @MorrisJobke

Copy link
Member

@LukasReschke LukasReschke left a comment

Choose a reason for hiding this comment

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

Works fine here. With regards to the theming integration I'd recommend:

  1. For the header just use the configured logo of the instance.
  2. For the footer use nothing if a custom logo is configured. If none is configured use the Nextcloud logo.

With regard to the color issue pointed out by @Espina2, what is the hex code that we should use there? :-)

*
* @param string $logoUrl
*/
public function addHeader($logoUrl);
Copy link
Member

Choose a reason for hiding this comment

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

I'd say we can remove $logoUrl from the interface. Let that automatically be detected. Also easier because otherwise it's a mess if you in the controller have to detect theming etc…

* @param string $logoUrl
* @param string $text
*/
public function addFooter($logoUrl, $text);
Copy link
Member

Choose a reason for hiding this comment

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

Also here I'd remove $logoUrl

Copy link
Member

Choose a reason for hiding this comment

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

Also let's make the text optional and by default go with the default footer :)

@LukasReschke
Copy link
Member

LukasReschke commented Apr 7, 2017

Yikes… The Provisioning API has a "Resend welcome mail" endpoint which was implemented by copy-pasting from the user creation controller. Absolutely not error prone 😉 Let me adjust that…

$mailData = array(
'username' => $username,
'url' => $link
$emailTemplate = new EMailTemplate($this->defaults);
Copy link
Member

Choose a reason for hiding this comment

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

Let's add a getEmailTemplate helper to IMailer instead :-)

Copy link
Member

Choose a reason for hiding this comment

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

Mhm. Actually not sure, separation of concerns et al, need to think about it :)

@LukasReschke LukasReschke self-assigned this Apr 7, 2017
@LukasReschke
Copy link
Member

LukasReschke commented Apr 7, 2017

There's a small bug in the theming code which I'm going to commit here as well, but then we already can have nicely themed mails:

themed

… well, or at least: "somewhat nicely themed" 😉

@LukasReschke
Copy link
Member

Note that I've removed the small gray Nextcloud logo at the bottom simply because that will cause a mess with theming and we should aim for consistency. And this is also already way nicer than before 😄

@MorrisJobke MorrisJobke added 3. to review Waiting for reviews and removed 2. developing Work in progress labels Apr 7, 2017
@MorrisJobke
Copy link
Member Author

Review time

@LukasReschke LukasReschke removed their assignment Apr 7, 2017
@codecov-io
Copy link

codecov-io commented Apr 7, 2017

Codecov Report

Merging #4244 into master will increase coverage by 0.04%.
The diff coverage is 77.77%.

@@             Coverage Diff              @@
##             master    #4244      +/-   ##
============================================
+ Coverage     54.04%   54.08%   +0.04%     
- Complexity    21299    21329      +30     
============================================
  Files          1259     1259              
  Lines         74231    74303      +72     
============================================
+ Hits          40115    40186      +71     
- Misses        34116    34117       +1
Impacted Files Coverage Δ Complexity Δ
apps/provisioning_api/lib/AppInfo/Application.php 100% <100%> (ø) 6 <0> (ø) ⬇️
settings/Application.php 100% <100%> (ø) 3 <0> (ø) ⬇️
lib/private/Server.php 93.13% <100%> (+0.14%) 120 <0> (ø) ⬇️
...rovisioning_api/lib/Controller/UsersController.php 83.96% <66.66%> (-0.22%) 107 <0> (ø)
lib/private/Mail/EMailTemplate.php 73.01% <73.01%> (ø) 21 <21> (?)
settings/Mailer/NewUserMailHelper.php 76.11% <76.11%> (ø) 8 <8> (?)
settings/Controller/UsersController.php 63.78% <83.33%> (-1.55%) 87 <0> (-2)
apps/theming/lib/ThemingDefaults.php 83.9% <86.66%> (+2.08%) 30 <1> (+3) ⬆️
lib/public/AppFramework/Http/TemplateResponse.php 70.83% <0%> (-25%) 9% <0%> (ø)
lib/private/Security/CertificateManager.php 92.78% <0%> (-1.04%) 38% <0%> (ø)
... and 6 more

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 325f925...8daf3d4. Read the comment docs.

@MorrisJobke
Copy link
Member Author

I tested the changes and it works really nice 👍 from me

* thanks to @Espina2 for make this nice design
* the button says "Set password" if the admin didn't specified a password

Signed-off-by: Morris Jobke <[email protected]>
Signed-off-by: Lukas Reschke <[email protected]>
Add support for theming in generated emails and simplify API

Signed-off-by: Lukas Reschke <[email protected]>
Signed-off-by: Lukas Reschke <[email protected]>
@MorrisJobke MorrisJobke added design Design, UI, UX, etc. enhancement labels Apr 7, 2017
@LukasReschke
Copy link
Member

👍

@oparoz
Copy link
Member

oparoz commented Apr 7, 2017

What does the text version look like?

@LukasReschke
Copy link
Member

What does the text version look like?

Thou shall take a look at the unit tests 😉

https://github.com/nextcloud/server/blob/8daf3d4a70bc97b6680956f6b13143e184a83c96/tests/data/emails/new-account-email-custom.txt

@MorrisJobke
Copy link
Member Author

What does the text version look like?

Basically the same as before. It's only the text in the same order just without logo and styles.

@Espina2
Copy link
Contributor

Espina2 commented Apr 7, 2017

I really prefer if after the Welcome a board, we have the name of the person, it would look like the email is written by one people and not autogenerated, looks more personal.

@oparoz
Copy link
Member

oparoz commented Apr 7, 2017

Thank you guys :) 👍

@MorrisJobke
Copy link
Member Author

I really prefer if after the Welcome a board, we have the name of the person, it would look like the email is written by one people and not autogenerated, looks more personal.

But in some cases we don't have the name. If the name is available we will put it there. 😉

@MorrisJobke
Copy link
Member Author

if a display name is set for the user it says "Welcome aboard DISPLAYNAME"

cc @Espina2

@MorrisJobke
Copy link
Member Author

Awesome sauce! 🚀

@MorrisJobke MorrisJobke merged commit 8838ed4 into master Apr 7, 2017
@MorrisJobke MorrisJobke deleted the welcome-email branch April 7, 2017 19:52
@MorrisJobke MorrisJobke added this to the Nextcloud 12.0 milestone Apr 7, 2017
@Espina2
Copy link
Contributor

Espina2 commented Apr 7, 2017

Awesome. Nice work Morris!

@MorrisJobke
Copy link
Member Author

Awesome. Nice work Morris!

You had the major impact on this! You designed a really awesome template :) Thank you as well :) You rock 🚀 😄

@jancborchardt
Copy link
Member

Great work everyone! :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3. to review Waiting for reviews design Design, UI, UX, etc. enhancement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants