-
-
10 May 2019 20:16:32 UTC
- Distribution: Mail-URLFor
- Module version: 0.03
- Source (raw)
- Browse (raw)
- Changes
- How to Contribute
- Repository
- Issues (1)
- Testers (446 / 0 / 0)
- Kwalitee
Bus factor: 1- 51.31% Coverage
- License: perl_5
- Perl: v5.8.0
- Activity
24 month- Tools
- Download (14.91KB)
- MetaCPAN Explorer
- Permissions
- Subscribe to distribution
- Permalinks
- This version
- Latest version
- NAME
- SYNOPSIS
- ONLINE DEMO
- DESCRIPTION
- METHODS
- REPOSITORY
- SUPPORT
- BUG TRACKER
- AUTHOR
- COPYRIGHT (c)
- LICENSE
NAME
Mail::URLFor - Create deep links into mail clients
SYNOPSIS
my $links = Mail::URLFor->new(); my $messageid = 'mail.abcdef.123456@example.com'; my $urls = $links->urls_for($messageid); for my $client (keys %$urls) { print "$client: $urls->{$client}\n"; }; # Output: # Thunderlink: thunderlink://messageid=mail.abcdef.123456%40example.com # OSX: message:%3Cmail.abcdef.123456@example.com%3E # RFC2392: mid:mail.abcdef.123456@example.com # Gmail: https://mail.google.com/mail/#search/rfc822msgid%3Amail.abcdef.123456%40example.com
ONLINE DEMO
There is an online demo of the functionality at http://corion.net/mail-urlfor.psgi .
Paste a valid message id into the input field and click on the appropriate link to open the email in that mail client if the mail exists in that mail client.
DESCRIPTION
This module allows you to create (clickable) URLs to emails that will open in the respective (native) client or Gmail.
This is useful if you have a web application but still want to connect an object on the web page with an email in a local mail client.
METHODS
Mail::URLFor->new
# Only link to mails on Gmail my $links = Mail::URLFor->new( clients => [Mail::URLFor::Plugin::Gmail->new], );
Options
- clients
-
Arrayref of the classes (or instances) of mail clients to render links for.
Defaults to all
::Plugin
classes.
->url_for( $rfc822messageid, $client = 'Gmail' )
my $url = $links->url_for( '1234.abc@example.com', 'Gmail' ); print "<a href="$url">See mail</a>"
Renders the URL using the moniker of the plugin.
Returns something that should mostly be treated as an opaque string. Returns
undef
, if the moniker is unknown.Currently, the returned string is always percent-encoded already, but this may change in the future.
->urls_for( $rfc822messageid )
my $urls = $links->urls_for( '1234.abc@example.com' ); print $urls->{'Gmail'};
REPOSITORY
The public repository of this module is http://github.com/Corion/Mail::URLFor.
SUPPORT
The public support forum of this module is https://perlmonks.org/.
BUG TRACKER
Please report bugs in this module via the RT CPAN bug queue at https://rt.cpan.org/Public/Dist/Display.html?Name=Mail-URLFor or via mail to mail-urlfor-Bugs@rt.cpan.org.
AUTHOR
Max Maischein
corion@cpan.org
COPYRIGHT (c)
Copyright 2019 by Max Maischein
corion@cpan.org
.LICENSE
This module is released under the same terms as Perl itself.
Module Install Instructions
To install Mail::URLFor, copy and paste the appropriate command in to your terminal.
cpanm Mail::URLFor
perl -MCPAN -e shell install Mail::URLFor
For more information on module installation, please visit the detailed CPAN module installation guide.