Add distinction between mailing managers and admins.
This commit is contained in:
parent
a1d8ab6f70
commit
36a51a17a3
6 changed files with 152 additions and 23 deletions
|
|
@ -157,10 +157,10 @@ sub installMailingTables {
|
|||
# Remname tables from a previous (bad) name to a new (good) one.
|
||||
# Must be done before the crudCreateOrUpdate calls to prevent creation of stale tables.
|
||||
my @tables = $db->buildArray( 'show tables' );
|
||||
if ( grep { $_ eq 'WGMailing' } @tables ) {
|
||||
if ( scalar grep { $_ eq 'WGMailing' } @tables ) {
|
||||
$db->write( 'rename table WGMailing to Mailing' );
|
||||
}
|
||||
if ( grep { $_ eq 'WGMailing_queue' } @tables ) {
|
||||
if ( scalar grep { $_ eq 'WGMailing_queue' } @tables ) {
|
||||
$db->write( 'rename table WGMailing_queue to Mailing_email' );
|
||||
}
|
||||
|
||||
|
|
@ -180,7 +180,7 @@ sub installNewsletterInAdminConsole {
|
|||
|
||||
print "\tAdding newsletter admin console section...";
|
||||
$session->config->set( 'adminConsole/mailable', {
|
||||
groupSetting => "admins",
|
||||
groupSetting => "mailingManagerGroupId",
|
||||
icon => "newsletter.gif",
|
||||
title => "Newsletter",
|
||||
uiLevel => 7,
|
||||
|
|
@ -197,14 +197,18 @@ sub installNewsletterSettings {
|
|||
|
||||
print "\tInstalling newsletter setting slots...";
|
||||
|
||||
$setting->add( 'newsletterReturnDomain', undef )
|
||||
unless $setting->has( 'newsletterReturnDomain' );
|
||||
my %settings = (
|
||||
newsletterReturnDomain => undef,
|
||||
newsletterBounceScoreThreshold => 0,
|
||||
mailingManagerTemplateId => 'FTfNhWI8KJOwLzFUl5rYeQ',
|
||||
mailingAdminGroupId => 3,
|
||||
mailingManagerGroupId => 3,
|
||||
mailingManagersCanOverrideDefault => 0,
|
||||
);
|
||||
|
||||
$setting->add( 'newsletterBounceScoreThreshold', 0 )
|
||||
unless $setting->has( 'newsletterBounceScoreThreshold' );
|
||||
|
||||
$setting->add( 'mailingManagerTemplateId', 'FTfNhWI8KJOwLzFUl5rYeQ' )
|
||||
unless $setting->has( 'mailingManagerTemplateId' );
|
||||
while ( my ($name, $value) = each %settings ) {
|
||||
$setting->add( $name => $value ) unless $setting->has( $name );
|
||||
}
|
||||
|
||||
print "Done.\n";
|
||||
}
|
||||
|
|
@ -221,13 +225,13 @@ sub addPluginsToConfigFile {
|
|||
} );
|
||||
|
||||
my @handlers = @{ $session->config->get('contentHandlers') };
|
||||
if ( !grep { $_ eq 'WebGUI::Content::NewsletterManager' } @handlers ) {
|
||||
if ( !scalar grep { $_ eq 'WebGUI::Content::NewsletterManager' } @handlers ) {
|
||||
insert_after_string 'WebGUI::Content::Shop', 'WebGUI::Content::NewsletterManager', @handlers;
|
||||
$session->config->set( 'contentHandlers', \@handlers );
|
||||
}
|
||||
|
||||
my @workflows = @{ $session->config->get('workflowActivities/None') };
|
||||
if ( !grep { $_ eq 'WebGUI::Workflow::Activity::SendQueuedMailings' } @workflows ) {
|
||||
if ( !scalar grep { $_ eq 'WebGUI::Workflow::Activity::SendQueuedMailings' } @workflows ) {
|
||||
push @workflows, 'WebGUI::Workflow::Activity::SendQueuedMailings';
|
||||
$session->config->set( 'workflowActivities/None', \@workflows );
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue