Add templatable notification for users to confirm via mail.
This commit is contained in:
parent
176938baf5
commit
7e113641be
3 changed files with 14 additions and 4 deletions
|
|
@ -40,6 +40,13 @@ sub definition {
|
|||
label => 'Allow anonymous subscription',
|
||||
tab => 'subscription',
|
||||
},
|
||||
confirmationRequiredTemplateId => {
|
||||
fieldType => 'template',
|
||||
defaultValue => 'd1tQuv-OlPwgz6PnLcq-hA',
|
||||
label => 'Confirmation required template',
|
||||
namespace => 'Subscriber/ConfirmationRequired',
|
||||
tab => 'subscription',
|
||||
},
|
||||
confirmationEmailSubject => {
|
||||
fieldType => 'text',
|
||||
defaultVale => 'Confirm your subscription mutation',
|
||||
|
|
@ -61,7 +68,7 @@ sub definition {
|
|||
},
|
||||
noMutationEmailTemplateId => {
|
||||
fieldType => 'template',
|
||||
defaultValue => '',
|
||||
defaultValue => 'Q8t7dUqMk05D2m7Jbgg4BQ',
|
||||
label => 'No mutation email template',
|
||||
namespace => 'Subscriber/NoMutationEmail',
|
||||
tab => 'subscription',
|
||||
|
|
@ -359,10 +366,12 @@ sub www_processSubscription {
|
|||
if ( $action eq 'unsubscribe' && $self->canUnsubscribe ) {
|
||||
$self->unsubscribe;
|
||||
}
|
||||
|
||||
return unless $self->get('alwaysConfirmSubscription');
|
||||
}
|
||||
elsif ( $self->get('allowAnonymousSubscription') ) {
|
||||
my $email = $form->email( 'email' );
|
||||
return 'no email' unless $email;
|
||||
return 'Error: no email address passed' unless $email;
|
||||
|
||||
my $emailUser = WebGUI::User::SpecialState->newByEmail( $session, $email );
|
||||
if ( $action eq 'unsubscribe' && defined $emailUser ) {
|
||||
|
|
@ -379,10 +388,10 @@ sub www_processSubscription {
|
|||
}
|
||||
}
|
||||
else {
|
||||
return 'anonymous subscription is not allowed.'
|
||||
return $self->processStyle( 'Anonymous subscription is not allowed. Please log in to (un)subscribe' );
|
||||
}
|
||||
|
||||
return;
|
||||
return $self->processStyle( $self->processTemplate( {}, $self->get('confirmationRequiredTemplateId') ) );
|
||||
}
|
||||
|
||||
#----------------------------------------------------------------------------
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue