Changeset 842

Show
Ignore:
Timestamp:
05/29/06 19:08:25
Author:
miyagawa
Message:

document Gmail plugin and make attachment_enclosures as optional

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/plagger/lib/Plagger/Plugin/Publish/Gmail.pm

    r840 r842  
    5656    my $subject = $feed->title || '(no-title)'; 
    5757 
    58     my $enclosure_cb; 
    59     for my $entry ($args->{feed}->entries) { 
    60         $enclosure_cb = $self->prepare_enclosures($entry); 
     58    my @enclosure_cb; 
     59    if ($self->conf->{attach_enclosures}) { 
     60        for my $entry ($args->{feed}->entries) { 
     61            push @enclosure_cb, $self->prepare_enclosures($entry); 
     62        } 
    6163    } 
    6264 
     
    8688    ); 
    8789 
    88     if ($enclosure_cb) { 
    89         $enclosure_cb->($msg); 
     90    for my $cb (@enclosure_cb) { 
     91        $cb->($msg); 
    9092    } 
    9193 
     
    244246 
    2452471; 
     248 
     249__END__ 
     250 
     251=head1 NAME 
     252 
     253Plagger::Plugin::Publish::Gmail - Notify updates to your email account 
     254 
     255=head1 SYNOPSIS 
     256 
     257  - module: Publish::Gmail 
     258    config: 
     259      mailto: example@gmail.com 
     260      mailfrom: you@example.net 
     261 
     262=head1 DESCRIPTION 
     263 
     264This plugin creates HTML emails and sends them to your Gmail mailbox. 
     265 
     266=head1 CONFIG 
     267 
     268=over 4 
     269 
     270=item mailto 
     271 
     272Your email address to send updatess to. Required. 
     273 
     274=item mailfrom 
     275 
     276Email address to send email from. Defaults to I<plagger@localhost>. 
     277 
     278=item mailroute 
     279 
     280Hash to specify how to send emails. Defaults to: 
     281 
     282  mailroute: 
     283    via: smtp 
     284    host: localhost 
     285 
     286the value of I<via> would be either I<smtp>, I<smtp_tls> or I<sendmail>. 
     287 
     288  mailroute: 
     289    via: sendmail 
     290    command: /usr/sbin/sendmail 
     291 
     292=item attach_enclosures 
     293 
     294Flag to attach enclosures as Email attachments. Defaults to 0. 
     295 
     296=back 
     297 
     298=head1 AUTHOR 
     299 
     300Tatsuhiko Miyagawa 
     301 
     302=head1 SEE ALSO 
     303 
     304L<Plagger>, L<MIME::Lite> 
     305 
     306=cut