52 lines
1.3 KiB
Perl
52 lines
1.3 KiB
Perl
package WebGUI::Mailing::Email;
|
|
|
|
use strict;
|
|
use warnings;
|
|
|
|
use base 'WebGUI::Crud';
|
|
|
|
sub crud_definition {
|
|
my $class = shift;
|
|
my $session = shift;
|
|
|
|
my $definition = $class->SUPER::crud_definition( $session );
|
|
|
|
$definition->{ tableName } = 'WGMailing_queue';
|
|
$definition->{ tableKey } = 'mailId';
|
|
$definition->{ sequenceKey } = 'mailingId';
|
|
|
|
my %properties = (
|
|
mailingId => {
|
|
fieldType => 'guid',
|
|
},
|
|
userId => {
|
|
fieldType => 'guid',
|
|
},
|
|
recipientEmail => {
|
|
fieldType => 'email',
|
|
defaultValue => undef,
|
|
},
|
|
status => {
|
|
fieldType => 'text',
|
|
defaultValue => 'queued', # Allowed are: 'queued', 'sent', 'error'
|
|
},
|
|
errorMessage => {
|
|
fieldType => 'text',
|
|
defaultValue => undef,
|
|
},
|
|
isTest => {
|
|
fieldType => 'yesNo',
|
|
defaultValue => 1, # For safety: explicitly turn this off to send real emails
|
|
},
|
|
);
|
|
|
|
$definition->{ properties } = {
|
|
%{ $definition->{ properties } || {} },
|
|
%properties,
|
|
};
|
|
|
|
return $definition;
|
|
}
|
|
|
|
1;
|
|
|