Git Product home page Git Product logo

mail-urlfor's Introduction

Travis Build Status AppVeyor Build Status

NAME

Mail::URLFor - Create deep links into mail clients

SYNOPSIS

my $links = Mail::URLFor->new();

my $messageid = '[email protected]';

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:%[email protected]%3E
# RFC2392: mid:[email protected]
# Gmail: https://mail.google.com/mail/#search/rfc822msgid%3Amail.abcdef.123456%40example.com

ONLINE DEMO

There is an online demo of the functionality at https://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( '[email protected]', '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( '[email protected]' );
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 [email protected].

AUTHOR

Max Maischein [email protected]

COPYRIGHT (c)

Copyright 2019 by Max Maischein [email protected].

LICENSE

This module is released under the same terms as Perl itself.

mail-urlfor's People

Contributors

corion avatar manwar avatar

Watchers

 avatar James Cloos avatar  avatar

Forkers

manwar

mail-urlfor's Issues

A little more detailed usecase documentation?

This is a very intriguing module. What scenarios or use cases does this enable?

For example if I send a customer an "onboarding" email from my applications can I then tell them in the account page - Revisit the on boarding email by clicking here - and provide a link?

What information to I have to control/store in order to be able to create that link?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.