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',
|
label => 'Allow anonymous subscription',
|
||||||
tab => 'subscription',
|
tab => 'subscription',
|
||||||
},
|
},
|
||||||
|
confirmationRequiredTemplateId => {
|
||||||
|
fieldType => 'template',
|
||||||
|
defaultValue => 'd1tQuv-OlPwgz6PnLcq-hA',
|
||||||
|
label => 'Confirmation required template',
|
||||||
|
namespace => 'Subscriber/ConfirmationRequired',
|
||||||
|
tab => 'subscription',
|
||||||
|
},
|
||||||
confirmationEmailSubject => {
|
confirmationEmailSubject => {
|
||||||
fieldType => 'text',
|
fieldType => 'text',
|
||||||
defaultVale => 'Confirm your subscription mutation',
|
defaultVale => 'Confirm your subscription mutation',
|
||||||
|
|
@ -61,7 +68,7 @@ sub definition {
|
||||||
},
|
},
|
||||||
noMutationEmailTemplateId => {
|
noMutationEmailTemplateId => {
|
||||||
fieldType => 'template',
|
fieldType => 'template',
|
||||||
defaultValue => '',
|
defaultValue => 'Q8t7dUqMk05D2m7Jbgg4BQ',
|
||||||
label => 'No mutation email template',
|
label => 'No mutation email template',
|
||||||
namespace => 'Subscriber/NoMutationEmail',
|
namespace => 'Subscriber/NoMutationEmail',
|
||||||
tab => 'subscription',
|
tab => 'subscription',
|
||||||
|
|
@ -359,10 +366,12 @@ sub www_processSubscription {
|
||||||
if ( $action eq 'unsubscribe' && $self->canUnsubscribe ) {
|
if ( $action eq 'unsubscribe' && $self->canUnsubscribe ) {
|
||||||
$self->unsubscribe;
|
$self->unsubscribe;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return unless $self->get('alwaysConfirmSubscription');
|
||||||
}
|
}
|
||||||
elsif ( $self->get('allowAnonymousSubscription') ) {
|
elsif ( $self->get('allowAnonymousSubscription') ) {
|
||||||
my $email = $form->email( 'email' );
|
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 );
|
my $emailUser = WebGUI::User::SpecialState->newByEmail( $session, $email );
|
||||||
if ( $action eq 'unsubscribe' && defined $emailUser ) {
|
if ( $action eq 'unsubscribe' && defined $emailUser ) {
|
||||||
|
|
@ -379,10 +388,10 @@ sub www_processSubscription {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
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') ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
#----------------------------------------------------------------------------
|
#----------------------------------------------------------------------------
|
||||||
|
|
|
||||||
|
|
@ -60,6 +60,7 @@ sub installSubscriberAspectTable {
|
||||||
subscriptionEnabled tinyint(1) not null default 0,
|
subscriptionEnabled tinyint(1) not null default 0,
|
||||||
alwaysConfirmSubscription tinyint(1) not null default 0,
|
alwaysConfirmSubscription tinyint(1) not null default 0,
|
||||||
allowAnonymousSubscription tinyint(1) not null default 0,
|
allowAnonymousSubscription tinyint(1) not null default 0,
|
||||||
|
confirmationRequiredTemplateId char(22) binary,
|
||||||
confirmationEmailTemplateId char(22) binary,
|
confirmationEmailTemplateId char(22) binary,
|
||||||
confirmationEmailSubject varchar(255),
|
confirmationEmailSubject varchar(255),
|
||||||
noMutationEmailTemplateId char(22) binary,
|
noMutationEmailTemplateId char(22) binary,
|
||||||
|
|
|
||||||
Binary file not shown.
Loading…
Add table
Add a link
Reference in a new issue