gtsafas / mailgun.perl Goto Github PK
View Code? Open in Web Editor NEWPerl wrapper for mailgun
Perl wrapper for mailgun
The real reason I was interested in issue #5 was that the clean-up would make it easier to swap out the useragent for one that can perform the HTTP requests asynchronously.
This is particularly useful, for example, in a web application where you want to send an email as part of a registration request. Naive code would make the email request send asynchronously. Yes, one could fork as well but that's also a bit overkill.
Mojo::UserAgent seems a prime candidate for achieving this, particularly as I'm using Mojolicious anyway.
I'll assign this issue for now and will look at it when 1) The DRY clean-up is agreed and done and 2) Performance dictates I actually need the async capability for sure!
Not a valid method, "stats". at /usr/local/share/perl/5.22.1/WWW/Mailgun.pm line 202.
I get an error Not Found - The requested item doesn’t exist at /usr/local/share/perl5/WWW/Mailgun.pm line 60.
using version WWW::Mailgun is up to date (0.4).
My code is below (for testing):
#!/usr/bin/perl -w
use strict;
use warnings;
use Date::Manip;
use MIME::Lite;
my $to = 'To Name <[email protected]>';
my $from = '[email protected]';
my $to_name = 'To Name';
my $to_email = '[email protected]';
my $subject = 'Testing Subject';
my $msg = 'Testing Message';
my $body = $msg;
use WWW::Mailgun;
my $mg = WWW::Mailgun->new({
key => 'KEYREDACTED',
domain => 'domain.com',
from => $from
});
$mg->send({
to => $to,
subject => $subject,
text => $body,
html => $body
});
would it be possible to release this to 0.54 on cpan ?
How may I help?
I sent an email here [email protected] but it had a delivery failure.
I’m going all in with Mailgun to replace a proprietary email marking system and will be using WWW::Mailgun.
How may I help with the Todo list? Should I just jump in or would you like to provide some direction? Specifically for now I’m interested in the Campaigns bit.
To the future,
Billy Carr
Hi, I just tried to install on CentOS and could not complete the test. I had to do
yum install perl-Crypt-SSLeay to get it working.
Error message was:
malformed JSON string, neither array, object, number, string or atom, at character offset 0 (before "LWP will support htt...") at /usr/local/share/perl5/WWW/Mailgun.pm
https://documentation.mailgun.com/user_manual.html#tagging
Mailgun supports up to 3 tags per email. Each tag is sent as a separate post-param. But since the send-method takes a hashref as input, only one tag can be added. Possible fix would to add a special key tags
with arrayref as value, which then gets unpacked into separate post-params. Pretty much exactly like attachments
in version 0.5
$mg->send({
subject => 'Your account for xyz',
....
tags => ['adminmail', 'newuser']
});
WWW::Mailgun fails to build with cpanm with the error: Can't locate Test/MockModule.pm
Installing Test::MockModule before fixes this issue.
It looks like you need to add Test::MockModule as a dependency.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.