Skip to content
Snippets Groups Projects
Commit 8a6ff69b authored by Guillaume ROUSSE's avatar Guillaume ROUSSE
Browse files

use text/html messages for email challenge

parent cfef2e41
No related branches found
No related tags found
No related merge requests found
......@@ -575,13 +575,11 @@ sub req_complete_challenge {
}
# build content
my $content;
my $tt2 = Template->new({
ENCODING => 'utf8',
PRE_CHOMP => CHOMP_ONE,
INCLUDE_PATH => $self->{configuration}->{setup}->{templates_dir} . "/mail",
});
my $template = 'send_authentication_token.tt2.txt';
my $data = {
app => {
url => $self->{configuration}->{app}->{url},
......@@ -592,17 +590,34 @@ sub req_complete_challenge {
to => $self->{in}->{email},
entityid => $self->{in}->{entityid},
token => $token->token(),
challenge_url => sprintf(
'%s&action=complete_challenge&federation=%s&entity=%s&email=%s',
$self->{configuration}->{app}->{url},
$self->{in}->{federation},
$self->{in}->{entity},
$self->{in}->{email},
),
lh => $self->{lh},
};
$tt2->process($template, $data, \$content);
my $text_content;
my $html_content;
$tt2->process('send_authentication_token.tt2.txt', $data, \$text_content);
$tt2->process('send_authentication_token.tt2.html', $data, \$html_content);
# wrap content in message
# wrap in message
my $message = MIME::Lite->new(
From => sprintf('eduGAIN Access Check <%s>', $self->{configuration}->{mailer}->{from}),
To => $self->{in}->{email},
Subject => encode("MIME-Header", sprintf('[eduGAIN Access Check] %s', $self->{lh}->maketext("Test accounts request"))),
Type =>'text/plain',
Data => $content,
From => sprintf('eduGAIN Access Check <%s>', $self->{configuration}->{mailer}->{from}),
To => $self->{in}->{email},
Subject => encode("MIME-Header", sprintf('[eduGAIN Access Check] %s', $self->{lh}->maketext("Test accounts request"))),
Type => 'multipart/alternative',
);
$message->attach(
Type =>'text/plain',
Data => $text_content
);
$message->attach(
Type =>'text/html',
Data => $html_content
);
# send message
......
......@@ -66,6 +66,11 @@ msgstr "Voici la liste des attributs utilisateur associés à ce compte de test.
msgid "Best Regards"
msgstr "Cordialement"
#. (challenge_url)
#: templates/mail/send_authentication_token.tt2.txt:6 templates/renater/mail/send_authentication_token.tt2.txt:6
msgid "Challenge URL: %1"
msgstr "URL du challenge: %1"
#: templates/renater/web/complete_challenge.tt2.html:13 templates/renater/web/complete_challenge.tt2.html:8 templates/renater/web/select_email.tt2.html:8 templates/renater/web/select_federation.tt2.html:8 templates/renater/web/select_sp.tt2.html:8 templates/web/complete_challenge.tt2.html:13 templates/web/complete_challenge.tt2.html:8 templates/web/select_email.tt2.html:8 templates/web/select_federation.tt2.html:8 templates/web/select_sp.tt2.html:8
msgid "Complete email challenge"
msgstr "Validez le challenge e-mail"
......@@ -219,9 +224,14 @@ msgstr "Ces addresses e-mail ont été extraites des métadonnées pour votre se
msgid "Those service providers have been extracted from the selected federation metadata."
msgstr "Ces fournisseurs de service ont été extrait des métadonnées de la fédération sélectionnée."
#: templates/mail/send_authentication_token.tt2.eml:10
msgid "To complete the creation of test accounts, paste the following validation token in the eduGAIN Access Check web form."
msgstr "Pour terminer la création de ces comptes de test, recopiez le code de validation suivant dans l'application eduGAIN Access Check."
#. (challenge_url, token)
#: templates/mail/send_authentication_token.tt2.html:7 templates/renater/mail/send_authentication_token.tt2.html:7
msgid "To complete the creation of test accounts, paste the following validation token in <a href=\"%1\">eduGAIN Access Check</a>: %2."
msgstr "Pour terminer la création de ces comptes de test, recopiez le code de validation suivant dans <a href=\"%1\">eduGAIN Access Check</a>: %2."
#: templates/mail/send_authentication_token.tt2.txt:5 templates/renater/mail/send_authentication_token.tt2.txt:5
msgid "To complete the creation of test accounts, paste the following validation token in eduGAIN Access Check:"
msgstr "Pour terminer la création de ces comptes de test, recopiez le code de validation suivant dans eduGAIN Access Check:"
#. (idp_displayname)
#: templates/renater/web/create_accounts.tt2.html:11 templates/web/create_accounts.tt2.html:11
......@@ -236,9 +246,9 @@ msgstr "Pour commencer à tester vos propres services, commencez par en sélecti
msgid "Type the name or entityID of service to test:"
msgstr "Entrez le nom ou l'identifiant (entityID) du service à tester:"
#: templates/mail/send_authentication_token.tt2.eml:12
msgid "Validation token:"
msgstr "Code de validation:"
#: templates/renater/mail/send_authentication_token.tt2.html:9
msgid "Validation token: %1"
msgstr "Code de validation: %1"
#: templates/renater/web/create_accounts.tt2.html:10 templates/web/create_accounts.tt2.html:10
msgid "You can now use these test accounts to login at your federated service."
......
nobase_templates_DATA = \
accounts/accounts.php.tt2 \
mail/send_authentication_token.tt2.txt \
mail/send_authentication_token.tt2.html \
web/errors.tt2.html \
web/home.tt2.html \
web/index.tt2.html \
......@@ -11,6 +12,7 @@ nobase_templates_DATA = \
web/create_accounts.tt2.html \
renater/accounts/accounts.php.tt2 \
renater/mail/send_authentication_token.tt2.txt \
renater/mail/send_authentication_token.tt2.html \
renater/web/errors.tt2.html \
renater/web/home.tt2.html \
renater/web/index.tt2.html \
......
......@@ -2,11 +2,9 @@
[% lh.maketext("Somebody with IP address [_1] has requested to create test accounts for eduGAIN Service Provider with entityID [_2].", sourceip, entityid) %]
[% lh.maketext("The address [_1] is mentioned in the eduGAIN metadata as a contact for this Service Provider.", to) %]
[% lh.maketext("To complete the creation of test accounts, paste the following validation token in the eduGAIN Access Check web form.") %]
[% lh.maketext("Validation token:") %] [% token %]
eduGAIN Access Check: [% app.url %]
[% lh.maketext("To complete the creation of test accounts, paste the following validation token in eduGAIN Access Check:") %]
- [% lh.maketext("Challenge URL: [_1]", challenge_url) %]
- [% lh.maketext("Validation token: [_1]", token) %]
[% lh.maketext("If the creation of test accounts was not initiated by you or a fellow administrator for the above Service Provider, please forward this email and contact [_1] to inform them about a potential abuse of the eduGAIN Access Check service.", app.support_email) %]
......
......@@ -2,11 +2,9 @@
[% lh.maketext("Somebody with IP address [_1] has requested to create test accounts for eduGAIN Service Provider with entityID [_2].", sourceip, entityid) %]
[% lh.maketext("The address [_1] is mentioned in the eduGAIN metadata as a contact for this Service Provider.", to) %]
[% lh.maketext("To complete the creation of test accounts, paste the following validation token in the eduGAIN Access Check web form.") %]
[% lh.maketext("Validation token:") %] [% token %]
eduGAIN Access Check: [% app.url %]
[% lh.maketext("To complete the creation of test accounts, paste the following validation token in eduGAIN Access Check:") %]
- [% lh.maketext("Challenge URL: [_1]", challenge_url) %]
- [% lh.maketext("Validation token: [_1]", token) %]
[% lh.maketext("If the creation of test accounts was not initiated by you or a fellow administrator for the above Service Provider, please forward this email and contact [_1] to inform them about a potential abuse of the eduGAIN Access Check service.", app.support_email) %]
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment