Commit 88476671 authored by IKEDA Soji's avatar IKEDA Soji
Browse files

[change] Owner notifications about subscription/unsubscription request no...

[change] Owner notifications about subscription/unsubscription request no longer contain on-time ticket. They can validate requests notified but have to log-in to manage the other held requests.
parent b714c6fc
......@@ -49,17 +49,15 @@ Subject: [% FILTER qencode %][%|loc(list.name)%]Subscription request to list %1[
[%|loc(list.name)-%]Dear owner of list %1,
A user asked to be added as a subscriber to your list. In order to list and manage pending subscription requests you should click on the following link:[%END%]
A user asked to be added as a subscriber to your list. If this is OK with you, you should click on the following link:[%END%]
[% IF user_interfaces.size() == 1 && user_interfaces.0 == 'mail' -%]
[% "${conf.email}@${conf.host}" | mailtourl({subject=>"AUTH ${keyauth} ADD ${list.name} ${who} ${gecos}"}) %]
[% 'ticket' | url_abs([one_time_ticket]) %]
[%|loc("${conf.email}@${conf.host}")%]If prefered, you can accept this subscription request sending an email to %1 with the following subject:[%END%]
AUTH [%keyauth%] ADD [%list.name%] [%who%] [%gecos%]
[%|loc%]That can be done using this mailto link:[%END%]
[% | mailtourl({subject => "auth ${keyauth} ADD ${list.name} ${who} ${gecos}"}) ~%]
[% conf.email %]@[% conf.host %]
[%~ END %]
[%|loc(conf.email,conf.host)%]Or send a message to %1@%2 with the following subject:[%END%]
AUTH [%keyauth%] ADD [%list.name%] [%who%] [%gecos%]
[%- ELSE -%]
[% 'auth' | url_abs([keyauth,'add',list.name],{email=>user.email}) %]
[%- END %]
[% IF custom_attribute %]
[%|loc%]The user has provided the following informations:[%END%]
......@@ -74,16 +72,14 @@ Subject: [% FILTER qencode %][%|loc(list.name)%]UNsubscription request from list
[%|loc(list.name)-%]Dear owner of list %1,
A user asked to be deleted from your list. If this is OK with you, you should click on the following link:[% END %]
[% 'ticket' | url_abs([one_time_ticket]) %]
[% IF user_interfaces.size() == 1 && user_interfaces.0 == 'mail' -%]
[% "${conf.email}@${conf.host}" | mailtourl({subject=>"AUTH ${keyauth} DEL ${list.name} ${who}"}) %]
[%|loc(conf.email,conf.host)%]Or send a message to %1@%2 with the following subject:[%END%]
AUTH [%keyauth%] DEL [%list.name%] [%who%]
[%|loc%]That can be done using this mailto link:[%END%]
[% | mailtourl({subject => "auth ${keyauth} DEL ${list.name} ${who}"}) ~%]
[% conf.email %]@[% conf.host %]
[%~ END %]
AUTH [%keyauth%] DEL [%list.name%] [%who%]
[%- ELSE -%]
[% 'auth' | url_abs([keyauth,'del',list.name],{email=>user.email}) %]
[%- END %]
[% ELSIF type == 'automatic_bounce_management' -%]
[% PROCESS 'automatic_bounce_management.tt2' -%]
......
......@@ -38,7 +38,7 @@
[%~ ELSIF heldaction == 'subscribe' ~%]
[%|loc%]Subscribe[%END%]
[%~ ELSE ~%]
[%|loc%]Validation[%END%]
[% heldaction %]
[%~ END %]
</h2>
<p><strong>
......@@ -181,6 +181,7 @@
[%~ ELSIF confirm_action == 'auth' ~%]
<input type="hidden" name="id" value="[% id %]" />
<input type="hidden" name="heldaction" value="[% heldaction %]" />
<input type="hidden" name="listname" value="[% listname %]" />
<input type="hidden" name="email" value="[% email %]" />
[%~ ELSIF confirm_action == 'del' ~%]
[% FOREACH e = email ~%]
......@@ -260,6 +261,19 @@
id="response_action_cancel" name="response_action_cancel"
value="[%|loc%]Cancel[%END%]" />
</div>
[% IF listname ~%]
<div>
[% IF heldaction == 'add' ~%]
<a href="[% 'subindex' | url_rel([listname]) %]">
[%|loc%]Review subscription requests[%END%]
</a>
[%~ ELSIF heldaction == 'del' ~%]
<a href="[% 'sigindex' | url_rel([listname]) %]">
[%|loc%]Review unsubscription requests[%END%]
</a>
[%~ END %]
</div>
[%~ END %]
[%~ ELSE ~%]
<div>
<input class="MainMenuLinks" type="submit"
......
......@@ -491,7 +491,7 @@ our %action_args = (
'automatic_lists_management' => [],
'automatic_lists_request' => ['family'],
'automatic_lists' => [],
'auth' => ['id', 'heldaction'],
'auth' => ['id', 'heldaction', 'listname'],
);
 
## Define the required parameters for each action
......@@ -17907,25 +17907,26 @@ sub do_automatic_lists {
}
 
sub do_auth {
wwslog('info', '(%s, %s, %s)', $in{'id'}, $in{'heldaction'}, $in{'email'});
wwslog('info', '(%s, %s, %s, %s)',
$in{'id'}, $in{'heldaction'}, $in{'listname'}, $in{'email'});
 
my $keyauth = $in{'id'};
my $heldaction = $in{'heldaction'};
my $listname = $in{'listname'};
my $email = Sympa::Tools::Text::canonic_email($in{'email'});
 
my $default_home = Conf::get_robot_conf($robot, 'default_home');
return $default_home
unless $keyauth
and $heldaction
and $email
and Sympa::Tools::Text::valid_email($email);
unless $email and Sympa::Tools::Text::valid_email($email);
 
@{$param}{qw(id heldaction email)} = ($keyauth, $heldaction, $email);
@{$param}{qw(id heldaction listname email)} =
($keyauth, $heldaction, $listname, $email);
 
# Action confirmed?
my $next_action = $session->confirm_action(
$in{'action'}, $in{'response_action'},
arg => "$keyauth,$heldaction,$email",
arg =>
join(',', grep {$_} ($keyauth, $heldaction, $listname, $email)),
previous_action => $default_home
);
return $next_action unless $next_action eq '1';
......
......@@ -1694,40 +1694,13 @@ sub send_notify_to_owner {
);
}
}
} elsif ($operation eq 'subrequest') {
} elsif ($operation eq 'sigrequest' or $operation eq 'subrequest') {
# Sends notifications by each so that auth links with owners'
# addresses will be included.
foreach my $owner (@rcpt) {
$param->{'one_time_ticket'} = Sympa::Ticket::create(
$owner,
$robot,
'subindex/'
. Sympa::Tools::Text::encode_uri($self->{'name'}),
$param->{'ip'}
);
unless (
Sympa::send_file(
$self, 'listowner_notification', [$owner], $param
)
) {
$log->syslog(
'notice',
'Unable to send template "listowner_notification" to %s list owner %s',
$self,
$owner
);
}
}
} elsif ($operation eq 'sigrequest') {
foreach my $owner (@rcpt) {
$param->{'one_time_ticket'} = Sympa::Ticket::create(
$owner,
$robot,
'sigindex/'
. Sympa::Tools::Text::encode_uri($self->{'name'}),
$param->{'ip'}
);
unless (
Sympa::send_file(
$self, 'listowner_notification', [$owner], $param
$self, 'listowner_notification', $owner, $param
)
) {
$log->syslog(
......
Supports Markdown
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