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

Allow emails to be themed. #13223

Merged
merged 4 commits into from Aug 2, 2018
Merged

Allow emails to be themed. #13223

merged 4 commits into from Aug 2, 2018

Conversation

diosmosis
Copy link
Member

Changes:

  • Add new event Emails.setThemeVariables that modifies the variables used to set the fonts/colors in emails. Currently internal. Used by ExampleTheme.
  • Change twig templates to use hex colors where it was using rgb colors before (apparently hex colors are better supported in email clients).

An email w/ ExampleTheme settings & a serif font:

image

Fixes #12919

@diosmosis diosmosis added this to the 3.6.0 milestone Jul 30, 2018
@diosmosis diosmosis added not-in-changelog For issues or pull requests that should not be included in our release changelog on matomo.org. Needs Review PRs that need a code review labels Jul 30, 2018
@mattab
Copy link
Member

mattab commented Aug 1, 2018

Noticed the color of Table of content regressed in the branch (it used to be darker grey):

screenshot from 2018-08-02 01-48-21

@mattab
Copy link
Member

mattab commented Aug 1, 2018

The main use case for this issue/PR is to be compatible with White Label. Just tested to configure WhiteLabel like this:

screenshot from 2018-08-02 01-55-00

and the HTML email report is un-changed.

-> was it supposed to work maybe?

@diosmosis
Copy link
Member Author

Created a WhiteLabel PR, here is a pic:

image

BTW, original issue should mention WhiteLabel if that is the main reason for it.

@mattab
Copy link
Member

mattab commented Aug 2, 2018

BTW, original issue should mention WhiteLabel if that is the main reason for it.

oops, sorry forgot to mention this!

LGTM, just the tests needs fixing (minor changes in the html/pdf reports)

@diosmosis diosmosis merged commit 59e6f48 into 3.x-dev Aug 2, 2018
@diosmosis diosmosis deleted the 12919-themed-email branch August 2, 2018 22:50
@tsteur
Copy link
Member

tsteur commented Aug 3, 2018

As mentioned in other PR eventually be good to

  1. Use an object instead of an array for getDefaultEmailStyles so auto completion and refactoring etc works . Like class EmailStyles { public $brandNameLong = ''; }

  2. Eventually we should define theme colors only in one place. Now a theme designer needs to set it in php plus less. Ideally we would only do this in PHP. There could be one Theme object to configure theme colors like class ThemeConfiguration { public $colorText = ''; public $colorLink = ''; } and then the class EmailStyles would remove quite a few properties and use where possible those colors. There wouldn't need to be any theme.less anymore as all colors would be possible to configure through PHP in one place. PHP would then add the less theme variables through AssetManager.addStylesheets event.

I think this should be done for consistency maybe at the latest in Matomo 4 or 5, or now if not too much work. Could be quick. FYI @mattab @diosmosis

@diosmosis
Copy link
Member Author

Could add these to new issue(s) for prioritization.

@mattab
Copy link
Member

mattab commented Aug 5, 2018

@diosmosis sounds good, could you create a new issue in 3.7.0?

@diosmosis
Copy link
Member Author

will do

@diosmosis
Copy link
Member Author

Created a PR and this issue: #13251

@mattab mattab added Enhancement For new feature suggestions that enhance Matomo's capabilities or add a new report, new API etc. c: Platform For Matomo platform changes that aren't impacting any of our APIs but improve the core itself. and removed not-in-changelog For issues or pull requests that should not be included in our release changelog on matomo.org. labels Aug 28, 2018
InfinityVoid pushed a commit to InfinityVoid/matomo that referenced this pull request Oct 11, 2018
* Allow emails to be themed.

* Tweaks + remove manual test code.

* Add brandNameLong to event & color links in email header.

* update test files
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c: Platform For Matomo platform changes that aren't impacting any of our APIs but improve the core itself. Enhancement For new feature suggestions that enhance Matomo's capabilities or add a new report, new API etc. Needs Review PRs that need a code review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants