Rand Stats

raku-mailgun

zef:tony-o

Mailgun

raku-mailgun

A very incomplete mailgun module. All it does is send messages.

Usage:

use Mailgun;

my $msg = Message.new(
  :from<no-reply@zef.pm>,
  :to<tony.odell@live.com>,
  :subject("you suck"),
  :text("haha you read this"),
);

my $client = Client.new(
  :domain<zef.pm>,
  :api-key<rofl>
);

dd $client.send($msg);
# {:id("<some-numbers\@zef.pm>"),
#  :message("Queued. Thank you.")
# }

Messages are defaultable so you don't need to provide the same info over and over:

my &email-generator = Message.new(
  :from<no-reply@zef.pm>,
  :subject<Welcome!>,
).defaults;

# some time in the future:

my $msg = email-generator(:to('some@one.'), :body('Hello, world!'));