Internationalized system messages.
This commit is contained in:
parent
bcb265e188
commit
2490e166d3
15 changed files with 422 additions and 79 deletions
|
|
@ -23,21 +23,21 @@ sub definition {
|
|||
tie my %properties, 'Tie::IxHash', (
|
||||
viewTemplateId => {
|
||||
fieldType => 'template',
|
||||
label => 'Template',
|
||||
label => $i18n->get( 'template' ),
|
||||
tab => 'display',
|
||||
defaultValue => 'aYVYFpofaYvmRYoHwl3x4w',
|
||||
namespace => 'NewsletterCollection',
|
||||
},
|
||||
recentIssueCount => {
|
||||
fieldType => 'integer',
|
||||
label => 'Number of recent issues',
|
||||
label => $i18n->get( 'number of recent issues' ),
|
||||
tab => 'display',
|
||||
defaultValue => 1,
|
||||
},
|
||||
);
|
||||
|
||||
push @{ $definition }, {
|
||||
assetName => $i18n->echo('newsletter'),
|
||||
assetName => $i18n->get('Newsletter Collection'),
|
||||
icon => 'newWobject.gif',
|
||||
autoGenerateForms => 1,
|
||||
tableName => 'NewsletterCollection',
|
||||
|
|
|
|||
|
|
@ -7,17 +7,6 @@ use Class::C3;
|
|||
use WebGUI::Macro;
|
||||
use Tie::IxHash;
|
||||
|
||||
##----------------------------------------------------------------------------
|
||||
#sub configureMailingForm {
|
||||
# my $self = shift;
|
||||
# my $f = WebGUI::HTMLForm->new( $session, { action => $self->getUrl } );
|
||||
# $f->hidden(
|
||||
# name => 'func'
|
||||
# value => '
|
||||
#
|
||||
# return $f;
|
||||
#}
|
||||
|
||||
#----------------------------------------------------------------------------
|
||||
sub definition {
|
||||
my $class = shift;
|
||||
|
|
@ -28,7 +17,7 @@ sub definition {
|
|||
tie my %properties, 'Tie::IxHash', (
|
||||
mailStyleTemplateId => {
|
||||
fieldType => 'template',
|
||||
label => 'Mail template',
|
||||
label => $i18n->get( 'mail template' ),
|
||||
tab => 'mailable',
|
||||
namespace => 'style',
|
||||
},
|
||||
|
|
@ -46,9 +35,11 @@ sub definition {
|
|||
|
||||
#----------------------------------------------------------------------------
|
||||
sub getEditTabs {
|
||||
my $self = shift;
|
||||
my $self = shift;
|
||||
my $session = $self->session;
|
||||
my $i18n = WebGUI::International->new( $session,'AssetAspect_Mailable' );
|
||||
|
||||
return ( $self->next::method, [ 'mailable', 'Mailing list', 9 ] );
|
||||
return ( $self->next::method, [ 'mailable', $i18n->get( 'mailing' ), 9 ] );
|
||||
}
|
||||
|
||||
#----------------------------------------------------------------------------
|
||||
|
|
@ -73,15 +64,18 @@ sub getSubject {
|
|||
|
||||
#----------------------------------------------------------------------------
|
||||
sub getMailingProperties {
|
||||
my $self = shift;
|
||||
my $self = shift;
|
||||
my $session = $self->session;
|
||||
my $i18n = WebGUI::International->new( $session,'AssetAspect_Mailable' );
|
||||
|
||||
tie my %properties, 'Tie::IxHash', (
|
||||
subject => {
|
||||
fieldType => 'text',
|
||||
label => 'subject',
|
||||
label => $i18n->get( 'subject' ),
|
||||
},
|
||||
styleTemplateId => {
|
||||
fieldType => 'template',
|
||||
label => 'Style template',
|
||||
label => $i18n->get( 'mail template' ),
|
||||
defaultValue=> $self->get('mailStyleTemplateId'),
|
||||
namespace => 'style',
|
||||
},
|
||||
|
|
@ -130,16 +124,5 @@ sub processContentAsUser {
|
|||
return $content;
|
||||
}
|
||||
|
||||
##----------------------------------------------------------------------------
|
||||
#sub www_configureMailing {
|
||||
# my $self = shift;
|
||||
#
|
||||
# my $f = $self->configureMailingForm;
|
||||
#
|
||||
# $f->submit( 'Next step' );
|
||||
#
|
||||
# return $self->processStyle( $f->print );
|
||||
#}
|
||||
|
||||
1;
|
||||
|
||||
|
|
|
|||
|
|
@ -14,63 +14,63 @@ sub definition {
|
|||
my $class = shift;
|
||||
my $session = shift;
|
||||
my $definition = shift;
|
||||
# my $i18n = WebGUI::International->new( $session,'AssetAspect_Subscriber' );
|
||||
my $i18n = WebGUI::International->new( $session,'AssetAspect_Subscriber' );
|
||||
|
||||
tie my %properties, 'Tie::IxHash', (
|
||||
subscriptionGroupId => {
|
||||
fieldType => 'subscriptionGroup',
|
||||
label => 'Subscription group',
|
||||
label => $i18n->get( 'Subscription group' ),
|
||||
tab => 'subscription',
|
||||
noFormPost => 1,
|
||||
},
|
||||
subscriptionEnabled => {
|
||||
fieldType => 'yesNo',
|
||||
defaultValue => 1,
|
||||
label => 'Enable subscription',
|
||||
label => $i18n->get( 'Enable subscription' ),
|
||||
tab => 'subscription',
|
||||
},
|
||||
alwaysConfirmSubscription => {
|
||||
fieldType => 'yesNo',
|
||||
defaultValue => 0,
|
||||
label => 'Always require subscription confirmation',
|
||||
label => $i18n->get( 'require confirmation' ),
|
||||
tab => 'subscription',
|
||||
},
|
||||
allowAnonymousSubscription => {
|
||||
fieldType => 'yesNo',
|
||||
defaultValue => 1,
|
||||
label => 'Allow anonymous subscription',
|
||||
label => $i18n->get( 'allow anonymous' ),
|
||||
tab => 'subscription',
|
||||
},
|
||||
confirmationRequiredTemplateId => {
|
||||
fieldType => 'template',
|
||||
defaultValue => 'd1tQuv-OlPwgz6PnLcq-hA',
|
||||
label => 'Confirmation required template',
|
||||
label => $i18n->get( 'confirmation required template' ),
|
||||
namespace => 'Subscriber/ConfirmationRequired',
|
||||
tab => 'subscription',
|
||||
},
|
||||
confirmationEmailSubject => {
|
||||
fieldType => 'text',
|
||||
defaultVale => 'Confirm your subscription mutation',
|
||||
label => 'Confirmation email subject',
|
||||
defaultValue => 'Confirm your subscription mutation',
|
||||
label => $i18n->get( 'confirmation email subject' ),
|
||||
tab => 'subscription',
|
||||
},
|
||||
confirmationEmailTemplateId => {
|
||||
fieldType => 'template',
|
||||
defaultValue => '4aLemgMrTFhG3eqg57jCpQ',
|
||||
label => 'Confirmation email template',
|
||||
label => $i18n->get( 'confirmation email template' ),
|
||||
namespace => 'Subscriber/ConfirmationEmail',
|
||||
tab => 'subscription',
|
||||
},
|
||||
noMutationEmailSubject => {
|
||||
fieldType => 'text',
|
||||
defaultVale => '(Un)subscribe result',
|
||||
label => 'No mutation email subject',
|
||||
defaultValue => '(Un)subscribe result',
|
||||
label => $i18n->get( 'no mutation subject' ),
|
||||
tab => 'subscription',
|
||||
},
|
||||
noMutationEmailTemplateId => {
|
||||
fieldType => 'template',
|
||||
defaultValue => 'Q8t7dUqMk05D2m7Jbgg4BQ',
|
||||
label => 'No mutation email template',
|
||||
label => $i18n->get( 'no mutation template' ),
|
||||
namespace => 'Subscriber/NoMutationEmail',
|
||||
tab => 'subscription',
|
||||
},
|
||||
|
|
@ -101,8 +101,10 @@ sub duplicate {
|
|||
#----------------------------------------------------------------------------
|
||||
sub getEditTabs {
|
||||
my $self = shift;
|
||||
my $session = $self->session;
|
||||
my $i18n = WebGUI::International->new( $session, 'AssetAspect_Subscriber' );
|
||||
|
||||
return ( $self->next::method, [ 'subscription', 'Subscription', 9 ] );
|
||||
return ( $self->next::method, [ 'subscription', $i18n->get('tab name'), 9 ] );
|
||||
}
|
||||
|
||||
#----------------------------------------------------------------------------
|
||||
|
|
@ -174,7 +176,7 @@ sub appendSubscriptionFormVars {
|
|||
my $self = shift;
|
||||
my $var = shift || {};
|
||||
my $session = $self->session;
|
||||
my $i18n = WebGUI::International->new( $session, 'Asset_NewsletterCollection' );
|
||||
my $i18n = WebGUI::International->new( $session, 'AssetAspect_Subscriber' );
|
||||
|
||||
# Setup form controls
|
||||
my $formHeader =
|
||||
|
|
@ -252,6 +254,7 @@ sub sendSubscriptionConfirmation {
|
|||
my $code = shift;
|
||||
my $action = shift || 'subscribe';
|
||||
my $session = $self->session;
|
||||
my $i18n = WebGUI::International->new( $session, 'AssetAspect_Subscriber' );
|
||||
|
||||
my $var = $self->getEmailVars( $user );
|
||||
my $url = $session->url->getSiteURL . $self->getUrl( "func=confirmMutation;code=$code" );
|
||||
|
|
@ -272,7 +275,7 @@ sub sendSubscriptionConfirmation {
|
|||
}
|
||||
else {
|
||||
$session->log->error( "Cannot instanciate confirmation email template with id [$templateId]" );
|
||||
$mail->addText( "Click here to confirm your (un)subscription: $url" );
|
||||
$mail->addText( sprintf $i18n->get( 'click to confirm fallback' ), $url );
|
||||
}
|
||||
|
||||
$mail->send;
|
||||
|
|
@ -286,6 +289,7 @@ sub sendNoMutationEmail {
|
|||
my $user = shift;
|
||||
my $action = shift || 'subscribe';
|
||||
my $session = $self->session;
|
||||
my $i18n = WebGUI::International->new( $session, 'AssetAspect_Subscriber' );
|
||||
|
||||
my $var = $self->getEmailVars( $user );
|
||||
$var->{ actionIsSubscribe } = $action eq 'subscribe';
|
||||
|
|
@ -303,7 +307,7 @@ sub sendNoMutationEmail {
|
|||
else {
|
||||
$session->log->error( "Cannot instanciate no mutation email template with id [$templateId]" );
|
||||
if ( $action eq 'subscribe' ) {
|
||||
$mail->addText( "This email address is already subscribed to " . $self->get('title') );
|
||||
$mail->addText( sprintf $i18n->get('already subscribed fallback'), $self->get('title') );
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -312,6 +316,7 @@ sub sendNoMutationEmail {
|
|||
return;
|
||||
}
|
||||
|
||||
#----------------------------------------------------------------------------
|
||||
sub logConfirmation {
|
||||
my $self = shift;
|
||||
my $code = shift || return;
|
||||
|
|
@ -333,6 +338,7 @@ sub logConfirmation {
|
|||
return;
|
||||
};
|
||||
|
||||
#----------------------------------------------------------------------------
|
||||
sub logRequest {
|
||||
my $self = shift;
|
||||
my $type = shift || croak 'No type passed to logrequest';
|
||||
|
|
@ -453,6 +459,7 @@ sub www_processSubscription {
|
|||
my $self = shift;
|
||||
my $session = $self->session;
|
||||
my $form = $session->form;
|
||||
my $i18n = WebGUI::International->new( $session, 'AssetAspect_Subscriber' );
|
||||
|
||||
my $action = $form->get( 'action' );
|
||||
return unless $action eq 'subscribe' || $action eq 'unsubscribe';
|
||||
|
|
@ -486,7 +493,7 @@ sub www_processSubscription {
|
|||
}
|
||||
}
|
||||
else {
|
||||
return $self->processStyle( 'Anonymous subscription is not allowed. Please log in to (un)subscribe' );
|
||||
return $self->processStyle( $i18n->get( 'anonnymous not allowed' ) );
|
||||
}
|
||||
|
||||
return $self->processStyle( $self->processTemplate( {}, $self->get('confirmationRequiredTemplateId') ) );
|
||||
|
|
|
|||
|
|
@ -8,6 +8,7 @@ use WebGUI::Mailing::Admin;
|
|||
|
||||
use base 'WebGUI::Crud';
|
||||
|
||||
#----------------------------------------------------------------------------
|
||||
sub canCancel {
|
||||
my $self = shift;
|
||||
|
||||
|
|
@ -15,6 +16,7 @@ sub canCancel {
|
|||
return 0;
|
||||
}
|
||||
|
||||
#----------------------------------------------------------------------------
|
||||
sub cancel {
|
||||
my $self = shift;
|
||||
|
||||
|
|
@ -28,6 +30,7 @@ sub cancel {
|
|||
return;
|
||||
}
|
||||
|
||||
#----------------------------------------------------------------------------
|
||||
sub crud_definition {
|
||||
my $class = shift;
|
||||
my $session = shift;
|
||||
|
|
@ -68,6 +71,7 @@ sub crud_definition {
|
|||
return $definition;
|
||||
}
|
||||
|
||||
#----------------------------------------------------------------------------
|
||||
sub delete {
|
||||
my $self = shift;
|
||||
|
||||
|
|
@ -76,6 +80,7 @@ sub delete {
|
|||
return $self->SUPER::delete;
|
||||
}
|
||||
|
||||
#----------------------------------------------------------------------------
|
||||
sub deleteQueuedEmails {
|
||||
my $self = shift;
|
||||
|
||||
|
|
@ -87,6 +92,7 @@ sub deleteQueuedEmails {
|
|||
return;
|
||||
}
|
||||
|
||||
#----------------------------------------------------------------------------
|
||||
sub getAsset {
|
||||
my $self = shift;
|
||||
my $session = $self->session;
|
||||
|
|
@ -96,6 +102,7 @@ sub getAsset {
|
|||
return $asset;
|
||||
}
|
||||
|
||||
#----------------------------------------------------------------------------
|
||||
sub getQueuedEmailIterator {
|
||||
my $self = shift;
|
||||
my $session = $self->session;
|
||||
|
|
@ -103,6 +110,7 @@ sub getQueuedEmailIterator {
|
|||
return WebGUI::Mailing::Email->getQueued( $session, $self->getId );
|
||||
}
|
||||
|
||||
#----------------------------------------------------------------------------
|
||||
sub getNextInSendQueue {
|
||||
my $class = shift;
|
||||
my $session = shift;
|
||||
|
|
@ -119,6 +127,7 @@ sub getNextInSendQueue {
|
|||
return $it->();
|
||||
}
|
||||
|
||||
#----------------------------------------------------------------------------
|
||||
sub getStatusLine {
|
||||
my $self = shift;
|
||||
my $db = $self->session->db;
|
||||
|
|
@ -147,6 +156,7 @@ sub getStatusLine {
|
|||
return $output;
|
||||
}
|
||||
|
||||
#----------------------------------------------------------------------------
|
||||
sub queueTestEmails {
|
||||
my $self = shift;
|
||||
my $to = shift;
|
||||
|
|
@ -168,6 +178,7 @@ sub queueTestEmails {
|
|||
return;
|
||||
}
|
||||
|
||||
#----------------------------------------------------------------------------
|
||||
sub queueEmails {
|
||||
my $self = shift;
|
||||
my $userIds = shift;
|
||||
|
|
@ -187,6 +198,7 @@ sub queueEmails {
|
|||
return;
|
||||
}
|
||||
|
||||
#----------------------------------------------------------------------------
|
||||
sub sendQueuedEmails {
|
||||
my $self = shift;
|
||||
my $timeLimit = shift;
|
||||
|
|
@ -208,17 +220,24 @@ sub sendQueuedEmails {
|
|||
return 1;
|
||||
}
|
||||
|
||||
#----------------------------------------------------------------------------
|
||||
sub www_cancel {
|
||||
my $self = shift;
|
||||
my $session = $self->session;
|
||||
my $admin = WebGUI::Mailing::Admin->new( $session );
|
||||
my $i18n = WebGUI::International->new( $session, 'MailingManager' );
|
||||
|
||||
return 'Cannot cancel mailing ['.$self->getId.']' unless $self->canCancel;
|
||||
return $admin->adminConsole->render(
|
||||
sprintf( $i18n->get( 'cannot cancel mailing' ), $self->getId ),
|
||||
$i18n->get( 'error' )
|
||||
) unless $self->canCancel;
|
||||
|
||||
$self->cancel;
|
||||
|
||||
return WebGUI::Mailing::Admin->new($session)->www_view;
|
||||
}
|
||||
|
||||
#----------------------------------------------------------------------------
|
||||
sub www_delete {
|
||||
my $self = shift;
|
||||
my $session = $self->session;
|
||||
|
|
@ -228,9 +247,11 @@ sub www_delete {
|
|||
return WebGUI::Mailing::Admin->new($session)->www_view;
|
||||
}
|
||||
|
||||
#----------------------------------------------------------------------------
|
||||
sub www_edit {
|
||||
my $self = shift;
|
||||
my $session = $self->session;
|
||||
my $i18n = WebGUI::International->new( $session, 'MailingManager' );
|
||||
|
||||
my $f = WebGUI::HTMLForm->new( $session );
|
||||
$f->hidden(
|
||||
|
|
@ -258,7 +279,7 @@ sub www_edit {
|
|||
|
||||
$f->submit;
|
||||
|
||||
return WebGUI::Mailing::Admin->new($session)->getAdminConsole->render( $f->print, 'Configure mailing' );
|
||||
return WebGUI::Mailing::Admin->new($session)->getAdminConsole->render( $f->print, $i18n->get('configure mailing') );
|
||||
}
|
||||
|
||||
#----------------------------------------------------------------------------
|
||||
|
|
@ -274,9 +295,10 @@ sub www_previewContent {
|
|||
|
||||
#----------------------------------------------------------------------------
|
||||
sub www_previewEmail {
|
||||
my $self = shift;
|
||||
my $session = $self->session;
|
||||
my ( $form, $url ) = $session->quick( 'form', 'url' );
|
||||
my $self = shift;
|
||||
my $session = $self->session;
|
||||
my ( $form, $url ) = $session->quick( 'form', 'url' );
|
||||
my $i18n = WebGUI::International->new( $session, 'MailingManager' );
|
||||
|
||||
my $asset = $self->getAsset;
|
||||
my %recipients =
|
||||
|
|
@ -300,8 +322,8 @@ sub www_previewEmail {
|
|||
options => \%recipients,
|
||||
value => $userId,
|
||||
} )
|
||||
. WebGUI::Form::submit( $session, { value => 'Switch' } )
|
||||
. " <a href=\"$manageUrl\">Return to newsletter manager</a>"
|
||||
. WebGUI::Form::submit( $session, { value => $i18n->get( 'switch user') } )
|
||||
. " <a href=\"$manageUrl\">" . $i18n->get( 'return to manager' ) . "</a>"
|
||||
. WebGUI::Form::formFooter( $session );
|
||||
|
||||
return <<EOHTML;
|
||||
|
|
@ -318,6 +340,7 @@ sub www_previewEmail {
|
|||
EOHTML
|
||||
}
|
||||
|
||||
#----------------------------------------------------------------------------
|
||||
sub www_editSave {
|
||||
my $self = shift;
|
||||
my $session = $self->session;
|
||||
|
|
@ -337,9 +360,11 @@ sub www_editSave {
|
|||
return WebGUI::Mailing::Admin->new( $session )->www_view;
|
||||
}
|
||||
|
||||
#----------------------------------------------------------------------------
|
||||
sub www_sendBatch {
|
||||
my $self = shift;
|
||||
my $session = $self->session;
|
||||
my $i18n = WebGUI::International->new( $session, 'MailingManager' );
|
||||
|
||||
my $f = WebGUI::HTMLForm->new( $session );
|
||||
$f->hidden(
|
||||
|
|
@ -356,13 +381,14 @@ sub www_sendBatch {
|
|||
);
|
||||
$f->dateTime(
|
||||
name => 'schedule',
|
||||
label => 'Send batch at',
|
||||
label => $i18n->get( 'send mailing at' ),
|
||||
);
|
||||
$f->submit;
|
||||
|
||||
return WebGUI::Mailing::Admin->new($session)->getAdminConsole->render( $f->print, 'Send batch' );
|
||||
return WebGUI::Mailing::Admin->new($session)->getAdminConsole->render( $f->print, $i18n->get('schedule mailing') );
|
||||
}
|
||||
|
||||
#----------------------------------------------------------------------------
|
||||
sub www_sendBatchConfirm {
|
||||
my $self = shift;
|
||||
my $session = $self->session;
|
||||
|
|
@ -386,12 +412,15 @@ sub www_sendBatchConfirm {
|
|||
return WebGUI::Mailing::Admin->new( $session )->www_view;
|
||||
}
|
||||
|
||||
#----------------------------------------------------------------------------
|
||||
sub www_sendTestEmails {
|
||||
my $self = shift;
|
||||
my $session = $self->session;
|
||||
my $i18n = WebGUI::International->new( $session, 'MailingManager' );
|
||||
|
||||
|
||||
my $asset = WebGUI::Asset->newByDynamicClass( $session, $self->get('assetId') );
|
||||
croak "Cannot instaciate asset " . $self->get('assetId') unless $asset;
|
||||
croak "Cannot instanciate asset " . $self->get('assetId') unless $asset;
|
||||
|
||||
my $userIds = $asset->getRecipients;
|
||||
|
||||
|
|
@ -418,26 +447,26 @@ sub www_sendTestEmails {
|
|||
);
|
||||
$f->email(
|
||||
name => 'to',
|
||||
label => 'Send emails to test address',
|
||||
label => $i18n->get( 'test recipient' ),
|
||||
);
|
||||
$f->selectList(
|
||||
name => 'userIds',
|
||||
label => 'Generate test emails for user(s)',
|
||||
label => $i18n->get( 'test users' ),
|
||||
size => 10,
|
||||
multiple=> 1,
|
||||
options => \%options,
|
||||
);
|
||||
$f->submit( 'Send' );
|
||||
$f->submit( $i18n->get('send test mails') );
|
||||
|
||||
return $f->print;
|
||||
}
|
||||
|
||||
#----------------------------------------------------------------------------
|
||||
sub www_sendTestEmailsConfirm {
|
||||
my $self = shift;
|
||||
my $session = $self->session;
|
||||
my $form = $session->form;
|
||||
|
||||
# my $to = $form->email( 'to' );
|
||||
my $to = $form->get( 'to' );
|
||||
my @userIds = $form->selectList( 'userIds' );
|
||||
|
||||
|
|
@ -446,7 +475,5 @@ sub www_sendTestEmailsConfirm {
|
|||
return WebGUI::Mailing::Admin->new( $session )->www_view;
|
||||
}
|
||||
|
||||
|
||||
|
||||
1;
|
||||
|
||||
|
|
|
|||
|
|
@ -7,27 +7,30 @@ use Carp 'confess';
|
|||
use WebGUI::Asset;
|
||||
use WebGUI::AdminConsole;
|
||||
|
||||
|
||||
#----------------------------------------------------------------------------
|
||||
sub configurationComplete {
|
||||
my $self = shift;
|
||||
|
||||
return $self->session->setting->get('newsletterReturnDomain') ? 1 : 0;
|
||||
}
|
||||
|
||||
#----------------------------------------------------------------------------
|
||||
sub getAdminConsole {
|
||||
my $self = shift;
|
||||
my $session = $self->session;
|
||||
my $url = $session->url;
|
||||
my $i18n = WebGUI::International->new( $session, 'MailingManager' );
|
||||
|
||||
my $ac = WebGUI::AdminConsole->new( $session );
|
||||
|
||||
$ac->addSubmenuItem( $url->page( 'newsletter=manage' ), 'Manage mailings' );
|
||||
$ac->addSubmenuItem( $url->page( 'newsletter=manage;func=settings' ), 'Newsletter settings' );
|
||||
$ac->addSubmenuItem( $url->page( 'newsletter=bounce;func=bounceReport' ), 'Bounce scores' );
|
||||
$ac->addSubmenuItem( $url->page( 'newsletter=manage' ), $i18n->get( 'manage mailings' ) );
|
||||
$ac->addSubmenuItem( $url->page( 'newsletter=manage;func=settings' ), $i18n->get( 'newsletter settings' ) );
|
||||
$ac->addSubmenuItem( $url->page( 'newsletter=bounce;func=bounceReport' ), $i18n->get( 'bounce scores' ) );
|
||||
|
||||
return $ac;
|
||||
}
|
||||
|
||||
#----------------------------------------------------------------------------
|
||||
sub getMailables {
|
||||
my $self = shift;
|
||||
|
||||
|
|
@ -37,6 +40,7 @@ sub getMailables {
|
|||
} );
|
||||
}
|
||||
|
||||
#----------------------------------------------------------------------------
|
||||
sub new {
|
||||
my $class = shift;
|
||||
my $session = shift || confess 'No session passed';
|
||||
|
|
@ -44,10 +48,12 @@ sub new {
|
|||
bless { _session => $session }, $class;
|
||||
}
|
||||
|
||||
#----------------------------------------------------------------------------
|
||||
sub session {
|
||||
return (shift)->{ _session };
|
||||
}
|
||||
|
||||
#----------------------------------------------------------------------------
|
||||
sub www_createMailing {
|
||||
my $self = shift;
|
||||
my $session = $self->session;
|
||||
|
|
@ -66,10 +72,12 @@ sub www_createMailing {
|
|||
return $mailing->www_edit;
|
||||
}
|
||||
|
||||
#----------------------------------------------------------------------------
|
||||
sub www_settings {
|
||||
my $self = shift;
|
||||
my $session = $self->session;
|
||||
my $setting = $session->setting;
|
||||
my $i18n = WebGUI::International->new( $session, 'MailingManager' );
|
||||
|
||||
my $f = WebGUI::HTMLForm->new( $session );
|
||||
$f->hidden(
|
||||
|
|
@ -83,19 +91,20 @@ sub www_settings {
|
|||
$f->text(
|
||||
name => 'newsletterReturnDomain',
|
||||
value => $setting->get( 'newsletterReturnDomain' ),
|
||||
label => 'Newsletter domain name',
|
||||
label => $i18n->get( 'Newsletter domain name' ),
|
||||
);
|
||||
$f->integer(
|
||||
name => 'newsletterBounceScoreThreshold',
|
||||
value => $setting->get( 'newsletterBounceScoreThreshold' ),
|
||||
label => 'Bounce score threshold',
|
||||
label => $i18n->get( 'Bounce score threshold' ),
|
||||
);
|
||||
$f->submit;
|
||||
|
||||
return $self->getAdminConsole->render($f->print, 'Newsletter settings')
|
||||
return $self->getAdminConsole->render($f->print, $i18n->get( 'newsletter settings' ) );
|
||||
|
||||
}
|
||||
|
||||
#----------------------------------------------------------------------------
|
||||
sub www_settingsSave {
|
||||
my $self = shift;
|
||||
my $session = $self->session;
|
||||
|
|
@ -108,10 +117,12 @@ sub www_settingsSave {
|
|||
return $self->www_settings;
|
||||
}
|
||||
|
||||
#----------------------------------------------------------------------------
|
||||
sub www_view {
|
||||
my $self = shift;
|
||||
my $session = $self->session;
|
||||
my $url = $session->url;
|
||||
my $i18n = WebGUI::International->new( $session, 'MailingManager' );
|
||||
|
||||
return $self->www_settings unless $self->configurationComplete;
|
||||
|
||||
|
|
@ -165,7 +176,7 @@ sub www_view {
|
|||
my $var = { newsletter_loop => \@newsletterLoop };
|
||||
|
||||
my $template = WebGUI::Asset::Template->new( $self->session, 'FTfNhWI8KJOwLzFUl5rYeQ' );
|
||||
return $self->getAdminConsole->render( $template->process( $var ), 'Manage newsletters' );
|
||||
return $self->getAdminConsole->render( $template->process( $var ), $i18n->get( 'manage mailings' ) );
|
||||
}
|
||||
|
||||
1;
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@ use warnings;
|
|||
|
||||
use WebGUI::Mailing::Admin;
|
||||
|
||||
#----------------------------------------------------------------------------
|
||||
sub bounceScoreOk {
|
||||
my $self = shift;
|
||||
my $address = shift;
|
||||
|
|
@ -16,6 +17,7 @@ sub bounceScoreOk {
|
|||
return $self->getBounceScore( $address ) < $threshold;
|
||||
}
|
||||
|
||||
#----------------------------------------------------------------------------
|
||||
sub getBounceScore {
|
||||
my $self = shift;
|
||||
my $address = shift;
|
||||
|
|
@ -38,6 +40,7 @@ sub getBounceScore {
|
|||
return $score;
|
||||
}
|
||||
|
||||
#----------------------------------------------------------------------------
|
||||
sub new {
|
||||
my $class = shift;
|
||||
my $session = shift;
|
||||
|
|
@ -45,24 +48,26 @@ sub new {
|
|||
bless { _session => $session }, $class;
|
||||
}
|
||||
|
||||
#----------------------------------------------------------------------------
|
||||
sub session {
|
||||
return (shift)->{ _session };
|
||||
}
|
||||
|
||||
#----------------------------------------------------------------------------
|
||||
sub www_bounceReport {
|
||||
my $self = shift;
|
||||
my $session = $self->session;
|
||||
|
||||
my $i18n = WebGUI::International->new( $session, 'MailingManager' );
|
||||
my $sth = $session->db->read( 'select distinct sentTo from WGMailing_queue where sentTo is not null' );
|
||||
|
||||
my $output = '<table><tr><th>Email</th><th>Bounce score</th></tr>';
|
||||
my $output = '<table><tr><th>'.$i18n->get('email').'</th><th>'.$i18n->get('bounce score').'</th></tr>';
|
||||
while ( my ($email) = $sth->array ) {
|
||||
my $score = $self->getBounceScore( $email );
|
||||
$output .= "<tr><td>$email</td><td>$score</td></tr>";
|
||||
}
|
||||
$output .= '</table>';
|
||||
|
||||
return WebGUI::Mailing::Admin->new( $session )->getAdminConsole->render( $output, 'Bounce score overview' );
|
||||
return WebGUI::Mailing::Admin->new( $session )->getAdminConsole->render( $output, $i18n->get( 'bounce scores' ) );
|
||||
}
|
||||
|
||||
1;
|
||||
|
|
|
|||
|
|
@ -7,6 +7,7 @@ use HTML::TreeBuilder;
|
|||
|
||||
use base 'WebGUI::Crud';
|
||||
|
||||
#----------------------------------------------------------------------------
|
||||
sub crud_definition {
|
||||
my $class = shift;
|
||||
my $session = shift;
|
||||
|
|
@ -59,6 +60,7 @@ sub crud_definition {
|
|||
return $definition;
|
||||
}
|
||||
|
||||
#----------------------------------------------------------------------------
|
||||
sub getMailing {
|
||||
my $self = shift;
|
||||
my $session = $self->session;
|
||||
|
|
@ -68,6 +70,7 @@ sub getMailing {
|
|||
return $mailing;
|
||||
}
|
||||
|
||||
#----------------------------------------------------------------------------
|
||||
sub getQueuedTestEmails {
|
||||
my $class = shift;
|
||||
my $session = shift;
|
||||
|
|
@ -82,6 +85,7 @@ sub getQueuedTestEmails {
|
|||
return $it;
|
||||
}
|
||||
|
||||
#----------------------------------------------------------------------------
|
||||
sub getQueued {
|
||||
my $class = shift;
|
||||
my $session = shift;
|
||||
|
|
@ -98,6 +102,7 @@ sub getQueued {
|
|||
return $it;
|
||||
}
|
||||
|
||||
#----------------------------------------------------------------------------
|
||||
sub error {
|
||||
my $self = shift;
|
||||
my $message = shift;
|
||||
|
|
@ -110,6 +115,7 @@ sub error {
|
|||
return;
|
||||
}
|
||||
|
||||
#----------------------------------------------------------------------------
|
||||
sub absolutifyURIs {
|
||||
my $self = shift;
|
||||
my $content = shift;
|
||||
|
|
@ -137,6 +143,7 @@ sub absolutifyURIs {
|
|||
return $tb->as_HTML;
|
||||
}
|
||||
|
||||
#----------------------------------------------------------------------------
|
||||
sub send {
|
||||
my $self = shift;
|
||||
my $session = $self->session;
|
||||
|
|
@ -151,8 +158,7 @@ sub send {
|
|||
|
||||
# Mail is a test mail but there is noone to send the result to
|
||||
if ( $self->get( 'isTest' ) && !$self->get('recipientEmail') ) {
|
||||
$self->error( 'Cannot send test mails without an override reciepint address' );
|
||||
|
||||
$self->error( 'Cannot send test mails without an override recipient address' );
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
@ -216,6 +222,7 @@ sub send {
|
|||
return;
|
||||
}
|
||||
|
||||
#----------------------------------------------------------------------------
|
||||
sub user {
|
||||
my $self = shift;
|
||||
my $session = $self->session;
|
||||
|
|
@ -224,6 +231,7 @@ sub user {
|
|||
return $user;
|
||||
}
|
||||
|
||||
#----------------------------------------------------------------------------
|
||||
sub registerBounced {
|
||||
my $self = shift;
|
||||
my $reason = shift;
|
||||
|
|
@ -235,7 +243,7 @@ sub registerBounced {
|
|||
bounceReason => $reason,
|
||||
} );
|
||||
|
||||
#### TODO: Write to bounce log
|
||||
#### TODO: Write to bounce log <= is this necessary? We're writing to the mail log already with most relevant info...
|
||||
|
||||
return;
|
||||
}
|
||||
|
|
|
|||
18
lib/WebGUI/i18n/Dutch/AssetAspect_Mailable.pm
Normal file
18
lib/WebGUI/i18n/Dutch/AssetAspect_Mailable.pm
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
package WebGUI::i18n::Dutch::AssetAspect_Mailable;
|
||||
|
||||
use strict;
|
||||
|
||||
our $I18N = {
|
||||
'mail template' => {
|
||||
message => 'Mail stijl sjabloon',
|
||||
},
|
||||
'mailing' => {
|
||||
message => 'Mailing',
|
||||
},
|
||||
'subject' => {
|
||||
message => 'Onderwerp',
|
||||
},
|
||||
};
|
||||
|
||||
1;
|
||||
|
||||
60
lib/WebGUI/i18n/Dutch/AssetAspect_Subscriber.pm
Normal file
60
lib/WebGUI/i18n/Dutch/AssetAspect_Subscriber.pm
Normal file
|
|
@ -0,0 +1,60 @@
|
|||
package WebGUI::i18n::Dutch::AssetAspect_Subscriber;
|
||||
|
||||
use strict;
|
||||
|
||||
our $I18N = {
|
||||
'Subscription group' => {
|
||||
message => 'Abonnee groep',
|
||||
},
|
||||
'Enable subscription' => {
|
||||
message => 'Abonneren toestaan?',
|
||||
},
|
||||
'require confirmation' => {
|
||||
message => 'In/uitschrijving altijd verifieren?',
|
||||
},
|
||||
'allow anonymous' => {
|
||||
message => 'Anonieme inschrijvingen toestaan?',
|
||||
},
|
||||
'confirmation required template' => {
|
||||
message => 'Verificatie verplicht sjabloon',
|
||||
},
|
||||
'confirmation email subject' => {
|
||||
message => 'Verificatie email: onderwerp',
|
||||
},
|
||||
'confirmation email template' => {
|
||||
message => 'Verificatie email: sjabloon',
|
||||
},
|
||||
'no mutation subject' => {
|
||||
message => 'Geen wijziging email: onderwerp',
|
||||
},
|
||||
'no mutation template' => {
|
||||
message => 'Geen wijzigin email: sjabloon',
|
||||
},
|
||||
'tab name' => {
|
||||
message => 'Abonnement',
|
||||
},
|
||||
|
||||
|
||||
'subscribe' => {
|
||||
message => 'Inschrijven',
|
||||
},
|
||||
'unsubscribe' => {
|
||||
message => 'Uitschrijven',
|
||||
},
|
||||
|
||||
'click to confirm fallback' => {
|
||||
message => 'Klik hier om uw in/uitschrijving te bevestigen: %s',
|
||||
},
|
||||
'already subscribed fallback' => {
|
||||
message => 'Dit email adres is al in/uitgeschreven voor %s',
|
||||
},
|
||||
|
||||
'anonnymous not allowed' => {
|
||||
message => 'Anonieme inschrijvingen zijn niet toegestaan. Log in om in- of uit te schrijven.',
|
||||
},
|
||||
|
||||
};
|
||||
|
||||
1;
|
||||
|
||||
|
||||
19
lib/WebGUI/i18n/Dutch/Asset_NewsletterCollection.pm
Normal file
19
lib/WebGUI/i18n/Dutch/Asset_NewsletterCollection.pm
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
package WebGUI::i18n::Dutch::Asset_NewsletterCollection;
|
||||
|
||||
use strict;
|
||||
|
||||
our $I18N = {
|
||||
assetName => {
|
||||
message => 'Nieuwsbrief collectie',
|
||||
},
|
||||
'template' => {
|
||||
message => 'Sjabloon',
|
||||
},
|
||||
'number of recent issues' => {
|
||||
message => 'Aantal recente uitgaven',
|
||||
},
|
||||
|
||||
};
|
||||
|
||||
1;
|
||||
|
||||
64
lib/WebGUI/i18n/Dutch/MailingManager.pm
Normal file
64
lib/WebGUI/i18n/Dutch/MailingManager.pm
Normal file
|
|
@ -0,0 +1,64 @@
|
|||
package WebGUI::i18n::English::MailingManager;
|
||||
|
||||
use strict;
|
||||
|
||||
our $I18N = {
|
||||
'manage mailings' => {
|
||||
message => 'Beheer mailings',
|
||||
},
|
||||
'newsletter settings' => {
|
||||
message => 'Mailing instellingen',
|
||||
},
|
||||
'bounce scores' => {
|
||||
message => 'Bounce scores',
|
||||
},
|
||||
|
||||
'newsletter domain name' => {
|
||||
message => 'Mailing domeinnaam',
|
||||
},
|
||||
'bounce score threshold' => {
|
||||
message => 'Bounce score drempel',
|
||||
},
|
||||
|
||||
'email' => {
|
||||
message => 'Email',
|
||||
},
|
||||
'bounce score' => {
|
||||
message => 'Bounce score',
|
||||
},
|
||||
|
||||
'cannot cancel' => {
|
||||
message => 'Mailing \'%s\' kan niet worden afgebroken.',
|
||||
},
|
||||
'error' => {
|
||||
message => 'Er is een fout opgetreden',
|
||||
},
|
||||
'configure mailing' => {
|
||||
message => 'Configureer mailing',
|
||||
},
|
||||
'switch user' => {
|
||||
message => 'Verander gebruiker',
|
||||
},
|
||||
'return to manager' => {
|
||||
message => 'Terug naar mailing beheer.',
|
||||
},
|
||||
'send mailing at' => {
|
||||
message => 'Verstuur mailing vanaf',
|
||||
},
|
||||
'schedule mailing' => {
|
||||
message => 'Mailing inroosteren',
|
||||
},
|
||||
'test recipient' => {
|
||||
message => 'Ontvangadres voor test emails',
|
||||
},
|
||||
'test users' => {
|
||||
message => 'Genereer test emails voor',
|
||||
},
|
||||
'send test mails' => {
|
||||
message => 'Verstuur test emails',
|
||||
},
|
||||
|
||||
};
|
||||
|
||||
1;
|
||||
|
||||
|
|
@ -3,7 +3,15 @@ package WebGUI::i18n::English::AssetAspect_Mailable;
|
|||
use strict;
|
||||
|
||||
our $I18N = {
|
||||
|
||||
'mail template' => {
|
||||
message => 'Mail style template',
|
||||
},
|
||||
'mailing' => {
|
||||
message => 'Mailing',
|
||||
},
|
||||
'subject' => {
|
||||
message => 'Subject',
|
||||
},
|
||||
};
|
||||
|
||||
1;
|
||||
|
|
|
|||
60
lib/WebGUI/i18n/English/AssetAspect_Subscriber.pm
Normal file
60
lib/WebGUI/i18n/English/AssetAspect_Subscriber.pm
Normal file
|
|
@ -0,0 +1,60 @@
|
|||
package WebGUI::i18n::English::AssetAspect_Subscriber;
|
||||
|
||||
use strict;
|
||||
|
||||
our $I18N = {
|
||||
'Subscription group' => {
|
||||
message => 'Subscription group',
|
||||
},
|
||||
'Enable subscription' => {
|
||||
message => 'Enable subscription',
|
||||
},
|
||||
'require confirmation' => {
|
||||
message => 'Always require subscription confirmation?',
|
||||
},
|
||||
'allow anonymous' => {
|
||||
message => 'Allow anonymous subscription?',
|
||||
},
|
||||
'confirmation required template' => {
|
||||
message => 'Confirmation required template',
|
||||
},
|
||||
'confirmation email subject' => {
|
||||
message => 'Confirmation email subject',
|
||||
},
|
||||
'confirmation email template' => {
|
||||
message => 'Confirmation email template',
|
||||
},
|
||||
'no mutation subject' => {
|
||||
message => 'No mutation email subject',
|
||||
},
|
||||
'no mutation template' => {
|
||||
message => 'No mutation email template',
|
||||
},
|
||||
'tab name' => {
|
||||
message => 'Subscription',
|
||||
},
|
||||
|
||||
|
||||
'subscribe' => {
|
||||
message => 'Subscribe',
|
||||
},
|
||||
'unsubscribe' => {
|
||||
message => 'Unsubscribe',
|
||||
},
|
||||
|
||||
'click to confirm fallback' => {
|
||||
message => 'Click here to confirm your (un)subscription: %s',
|
||||
},
|
||||
'already subscribed fallback' => {
|
||||
message => 'This email address is already subscribed to %s',
|
||||
},
|
||||
|
||||
'anonnymous not allowed' => {
|
||||
message => 'Anonymous subscription is not allowed. Please log in to (un)subscribe',
|
||||
},
|
||||
|
||||
};
|
||||
|
||||
1;
|
||||
|
||||
|
||||
|
|
@ -3,12 +3,22 @@ package WebGUI::i18n::English::Asset_NewsletterCollection;
|
|||
use strict;
|
||||
|
||||
our $I18N = {
|
||||
assetName => {
|
||||
message => 'Newsletter collection',
|
||||
},
|
||||
'subscribe' => {
|
||||
message => 'subscribe',
|
||||
},
|
||||
'unsubscribe' => {
|
||||
message => 'unsubscribe',
|
||||
},
|
||||
'template' => {
|
||||
message => 'Template',
|
||||
},
|
||||
'number of recent issues' => {
|
||||
message => 'Number of recent issues',
|
||||
},
|
||||
|
||||
};
|
||||
|
||||
1;
|
||||
|
|
|
|||
63
lib/WebGUI/i18n/English/MailingManager.pm
Normal file
63
lib/WebGUI/i18n/English/MailingManager.pm
Normal file
|
|
@ -0,0 +1,63 @@
|
|||
package WebGUI::i18n::English::MailingManager;
|
||||
|
||||
use strict;
|
||||
|
||||
our $I18N = {
|
||||
'manage mailings' => {
|
||||
message => 'Manage mailings',
|
||||
},
|
||||
'newsletter settings' => {
|
||||
message => 'Newsletter settings',
|
||||
},
|
||||
'bounce scores' => {
|
||||
message => 'Bounce scores',
|
||||
},
|
||||
|
||||
'newsletter domain name' => {
|
||||
message => 'Newsletter domain name',
|
||||
},
|
||||
'bounce score threshold' => {
|
||||
message => 'Bounce score threshold',
|
||||
},
|
||||
|
||||
'email' => {
|
||||
message => 'Email',
|
||||
},
|
||||
'bounce score' => {
|
||||
message => 'Bounce score',
|
||||
},
|
||||
|
||||
'cannot cancel' => {
|
||||
message => 'Cannot cancel mailing \'%s\'.',
|
||||
},
|
||||
'error' => {
|
||||
message => 'An error occurred',
|
||||
},
|
||||
'configure mailing' => {
|
||||
message => 'Configure mailing',
|
||||
},
|
||||
'switch user' => {
|
||||
message => 'Switch user',
|
||||
},
|
||||
'return to manager' => {
|
||||
message => 'Return to mailing manager',
|
||||
},
|
||||
'send mailing at' => {
|
||||
message => 'Send mailing at',
|
||||
},
|
||||
'schedule mailing' => {
|
||||
message => 'Schedule mailing',
|
||||
},
|
||||
'test recipient' => {
|
||||
message => 'Recipient address for test emails',
|
||||
},
|
||||
'test users' => {
|
||||
message => 'Generate test emails for',
|
||||
},
|
||||
'send test mails' => {
|
||||
message => 'Send test emails',
|
||||
},
|
||||
};
|
||||
|
||||
1;
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue