Skip to content

Asynchronous send? #7

@kalgan

Description

@kalgan

Before of all, thank you for this great plugin! :)

I have a suggestion to add an option to send emails asynchronously.
Now, when sending email, the server waits for completion.

I'm using for this Proc::Simple::Async, then this process will go into background:

use Dancer::Plugin::Email;
use Proc::Simple::Async;

get '/emailme' => sub
{

    my $proc = async
    {
        my $msg = email {
            from    => 'robot@example.com',
            to      => 'user@example.com',
            subject => 'Async email',
            message => 'Hello!'
            };
        return $msg;
    }
    return 'message sent!';
};

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions