Commit 60e80fe1 authored by Christophe Maudoux's avatar Christophe Maudoux

Improve code (#1629)

parent fdaa0fb4
......@@ -41,19 +41,16 @@ has ott => (
sub init {
my ($self) = @_;
foreach (qw(mail2fCodeRegex mailSessionKey)) {
unless ( $self->conf->{$_} ) {
$self->error("Missing $_ parameter, aborting");
return 0;
}
$self->{conf}->{mail2fCodeRegex} ||= '\d{6}';
unless ( $self->conf->{mailSessionKey} ) {
$self->error("Missing 'mailSessionKey' parameter, aborting");
return 0;
}
$self->logo( $self->conf->{mail2fLogo} )
if ( $self->conf->{mail2fLogo} );
return $self->SUPER::init();
}
# RUNNING METHODS
sub run {
my ( $self, $req, $token ) = @_;
......@@ -80,7 +77,7 @@ sub run {
$subject = 'mail2fSubject';
$tr->( \$subject );
}
my ($body, $html);
my ( $body, $html );
if ( $self->conf->{mail2fBody} ) {
# We use a specific text message, no html
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment