Chris Travers > Mail-RoundTrip-0.02 > Mail::RoundTrip

Download:
Mail-RoundTrip-0.02.tar.gz

Dependencies

Annotate this POD

View/Report Bugs
Module Version: 0.02   Source  

NAME ^

Mail::RoundTrip - Management routines for round trip validation of users' emails

VERSION ^

Version 0.02

SYNOPSIS ^

To send validation email:

  my $validator = Mail::RoundTrip->new(
                      spool_dir => '/var/spool/myapp/contacts',
                        address => 'test@example.org',
                           data => $data,
                           from => 'me@example.com',
                       reply_to => 'not_me@example.com',
  );
  my $code = $validator->code;
  $validator->send_confirmation(template => $template);

To retrieve based on validation code:

  my $data = Mail::RoundTrip->get_data( code => $code, spool_dir => $dir );

DESCRIPTION ^

Many web applicatins rely on some sort of round-trip validation of user emails. This verifies that the email address, for example, is actually owned by the user. This module provides a minimalist set of routines for managing this process.

The module is curently minimalistic because it is assumed it will provide the common back-ends for a number of related verification routines. Extensions and feature requests are welcome. The module exposes a fully object-oriented interface.

The module basically provides a minimalist spooling service for holding data for later processing once the code has been provided.

PROPERTIES ^

address

The email address to be confirmed.

code

This is the random code used to authenticate the request. Currently this is generated as an sha2 256-bit hash of a pseudo-random value.

from

The address in the from header.

reply_to

The address in the reply to header.

return_path

The return path fo the email.

data

The data to be queued.

spool_dir

The spool directory to be used.

METHODS ^

send_confirmation(subject_prefix = $subpfx, template => $template)

This process the text in template $template, replacing __CODE__ with $self->code, setting the subject to "$subpfx $self->code" and sending out the email to the address provided.

get_data(code => $code, spool_dir => $directory)

This gets the data from spool_dir/directory and unlinks the file.

AUTHOR ^

Chris Travers, <chris.travers at gmail.com>

BUGS ^

Please report any bugs or feature requests to bug-mail-roundtrip at rt.cpan.org, or through the web interface at http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Mail-RoundTrip. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.

SUPPORT ^

You can find documentation for this module with the perldoc command.

    perldoc Mail::RoundTrip

You can also look for information at:

ACKNOWLEDGEMENTS ^

LICENSE AND COPYRIGHT ^

Copyright 2013 Chris Travers.

This program is released under the following license: BSD

syntax highlighting: