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

Feature/emails template improvement #1823

Merged
merged 26 commits into from
Jan 20, 2017

Conversation

whitx
Copy link

@whitx whitx commented Nov 11, 2016

Description

Allow the possibility to use translation for the emails template, also allow customizable emails template per portal profile.

Impacts

every flow that include eamil, billing, email source, sponsor, pre-registraiton, etc.

Issue

Fixes #1322

Delete branch after merge

NO

NEWS file entries

New Features

  • Now allow emails templates per portal profile
  • Now allow emails template to be added to the translation

UPGRADE file entries

@whitx whitx force-pushed the feature/emails-template-improvement branch 2 times, most recently from 714adf0 to 8b41e41 Compare November 14, 2016 18:32
msgstr ""

# html/captive-portal/templates/emails/emails-guest_local_account_creation.html
msgid "User Account"
Copy link
Collaborator

Choose a reason for hiding this comment

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

User account already exists, please use it.

Copy link
Author

Choose a reason for hiding this comment

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

This has been addressed

msgid "Hostname"
msgstr ""

msgid "MAC address"
Copy link
Collaborator

Choose a reason for hiding this comment

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

MAC Address already exists, please use it.

@whitx whitx force-pushed the feature/emails-template-improvement branch from 3b8c08e to 021f08c Compare January 16, 2017 16:29
@whitx
Copy link
Author

whitx commented Jan 16, 2017

Rebased

@extrafu
Copy link
Member

extrafu commented Jan 18, 2017

Bump

my $logger = get_logger();

use POSIX;
Copy link
Member

Choose a reason for hiding this comment

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

Probably better to define it on the top

use POSIX;
my $user_locale = clean_locale(setlocale(POSIX::LC_MESSAGES));
if ($type eq $SPONSOR_ACTIVATION) {
$logger->info('We are doing sponsor activation', $user_locale);
Copy link
Member

Choose a reason for hiding this comment

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

debug

$options{INCLUDE_PATH} = "$conf_dir/templates/";
$options{ENCODING} = "utf8";

use POSIX;
Copy link
Member

Choose a reason for hiding this comment

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

define on top

my ($locale) = @_;
if( $locale =~ /^([A-Za-z_]+)\./ ) {
$locale = $1;
}
Copy link
Member

Choose a reason for hiding this comment

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

else default locale ?

Copy link
Collaborator

Choose a reason for hiding this comment

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

That's fine, we just want to get rid of any extra dot-delimited part.

Copy link
Member

Choose a reason for hiding this comment

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

but if there is no dot ?

Copy link
Collaborator

Choose a reason for hiding this comment

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

if there's no dot, $locale doesn't change :)

Copy link
Member

Choose a reason for hiding this comment

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

Sure ? my $lang = clean_locale($self->app->session->{locale});

Copy link
Member

Choose a reason for hiding this comment

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

i prefer to have something more explicit like:
sub clean_locale {
my ($locale) = @;
if( $locale =~ /^([A-Za-z
]+)./ ) {
return $1;
}
return $locale;
}

Copy link
Collaborator

Choose a reason for hiding this comment

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

Oh! Just adding return $locale; would fix it.

@fdurand
Copy link
Member

fdurand commented Jan 19, 2017

Agree to merge

@lzammit
Copy link
Contributor

lzammit commented Jan 19, 2017

I've tested it and it works.

I've flagged one bug #1967 related to the email registration flow and an enhancement #1966 for the phone number cleaning.

Beside that, I had to do the create the translation manually so will need to do the translation on Transfix.

@whitx whitx merged commit 5d3674c into inverse-inc:devel Jan 20, 2017
@lzammit lzammit mentioned this pull request Jan 24, 2017
@whitx whitx deleted the feature/emails-template-improvement branch February 28, 2017 19:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants