#
# COPYRIGHT:
#
-# This software is Copyright (c) 1996-2012 Best Practical Solutions, LLC
+# This software is Copyright (c) 1996-2015 Best Practical Solutions, LLC
# <sales@bestpractical.com>
#
# (Except where explicitly superseded by other copyright notices)
print "\t-p, --print\t"
. loc("Print the resulting digest messages to STDOUT; don't mail them. Do not mark them as sent")
. "\n";
+ print "\t-v, --verbose\t" . loc("Give output even on messages successfully sent") . "\n";
print "\t-h, --help\t" . loc("Print this message") . "\n";
if ( $error eq 'help' ) {
}
}
-my ( $frequency, $print, $help ) = ( '', '', '' );
+my ( $frequency, $print, $verbose, $help ) = ( '', '', '', '' );
GetOptions(
'mode=s' => \$frequency,
'print' => \$print,
+ 'verbose' => \$verbose,
'help' => \$help,
);
my ( $contents_list, $contents_body ) = build_digest_for_user( $user, $all_digest->{$user} );
# Now we have a content head and a content body. We can send a message.
if ( send_digest( $user, $contents_list, $contents_body ) ) {
- print "Sent message to $user\n";
+ print "Sent message to $user\n" if $verbose;
mark_transactions_sent( $frequency, $user, values %{$sent_transactions->{$user}} ) unless ($print);
} else {
print "Failed to send message to $user\n";
}
# Set our sender and recipient.
- $digest_template->MIMEObj->head->replace( 'From', RT::Config->Get('CorrespondAddress') );
- $digest_template->MIMEObj->head->replace( 'To', $to );
+ $digest_template->MIMEObj->head->replace(
+ 'From', Encode::encode( "UTF-8", RT::Config->Get('CorrespondAddress') ) );
+ $digest_template->MIMEObj->head->replace(
+ 'To', Encode::encode( "UTF-8", $to ) );
if ($print) {
$digest_template->MIMEObj->print;