bogardo / mailgun Goto Github PK
View Code? Open in Web Editor NEWMailgun package for Laravel
License: MIT License
Mailgun package for Laravel
License: MIT License
By sending mail following error show:
RequestException in RequestException.php line 51: cURL error 60: SSL certificate problem: unable to get local issuer certificate
How to solve it?
When sending emails, one of my email methods has a couple of object passed to the view along with a few variables. When I leave the data array empty or just pass the variables it sends just fine, when passing in the objects I get an InvalidCredentials error:
exception 'Mailgun\Connection\Exceptions\InvalidCredentials' with message 'Your credentials are incorrect.' in /srv/www/example.dev/deploy/match/vendor/mailgun/mailgun-php/src/Mailgun/Connection/RestClient.php:130
Yes I saw #33, but this is different, I have no problems with the validating emails, and emails are sending most of the time.
This one works everytime: (only 2 or 3 variables are passed through $data)
private function sendTo(User $user, $subject, $view, $data = [], $from = '') {
return Mailgun::send($view, $data, function ($message) use ($user, $subject, $from) {
if($from) {
$message->from($from);
}
$message->to($user->email, $user->full_name)
->subject($subject);
});
}
This one does NOT work: (two object and 3 variables are being passed to $data)
private function sendToAdmin($adminEmail, $subject, $view, $data = []) {
return Mailgun::send($view, $data, function ($message) use ($adminEmail, $subject) {
$message->to($adminEmail)
->subject($subject);
});
}
when changing the $data to an empty array in the send method it sends.
In mailgun-php:1.6 the ability to rename attachments has been added. See Pull Request 29
Add the renaming ability to this package.
Was super easy to drop this in and change the application Mail alias and update all our mailgun sends (SMTP is way too slow). Thanks! :)
For some reason i am able to add a member to a list in my dev environment, but it's not working in my production.
Mailgun::send() is working fine.
Any idea why?
Hello I've been using this plug in without any issue. However, with my last update on my project where I'm using "guzzlehttp/guzzle:~6.1.1", "guzzlehttp/oauth-subscriber: dev-master" for Oauth. So now composer wouldn't install the plug in due to dependency version. So I wanted to ask you guys whether, you are planning to update your project any sooner, or any workaround.
Attaching files to the email works . . . but the attachment also appears inline in the email.
This is the code used:
$message->attach(data['path'], $data['name']);
How to prevent it appearing inline?
I realize laravel 5 is not yet released but we are getting very close. Would be really great to have the Mailgun package working with laravel 5 when it's released. Your package is such a great package. Many thanks for all you work. It's been a life saver.
Hi,
First of all, thank you for this awesome package. Very easy to use!
However, I have a question. On my local machine, the sending of email works perfectly fine. However when I deployed it to my test server, I keep getting the ff. error:
Mailgun \ Connection \ Exceptions \ MissingEndpoint
The endpoint you've tried to access does not exist. Check your URL.
Is there anything that I miss or I have to configure when deploying?
Thanks,
Ridvan
It appears the bogardo/mailgun 4.0.* for Laravel 5 package has a conflict with one of my other packages.
My other package requires guzzlehttp/guzzle 6.1.1 but when I try to add this package I get a composer error:
Can this be changed so your package has a MINIMUM requirement for guzzle 5.0. Having a newer version of Guzzle should not inhibit the installation of this package.
Some emails that I send keep getting put into the spam folders of some email servers.
I poured through your docs to maybe pinpoint the issue, but could not.
I contacted Mailgun support to maybe shed some light on the issue, and they said it could be that my 'message-id' in my email header is wrong since it shows 'Message-Id: 282dc62aa198e497a5358f0aeeff56da@localhost. He mentioned that it should, in reality, be the same as the 'From:' address in the email.
Maybe this is a bug on your end? If not, please let me know common causes of this issue, if you have knowledge of them.
Hey,
I like your package. kindly add List support (i.e. Adding to List, removing, updating etc)
Cheeers!
.DS_Store
is user-specific and should not appear in a project.gitignore
. Consider adding it to the user global.gitignore
instead.
/vendor
composer.phar
composer.lock
.DS_Store
/src/views
/src/config/config.dev.php
Posted from SensioLabsInsight
What's the best way to send an email to multiple recipients?
Ideally, I'd like to be able to pass an array of email addresses to the $message->to() function, like you can using Laravel's default Mail object.
I am using Laravel 4.2.*. I install this lib using composer and when i am trying to publish config i am getting following error
[InvalidArgumentException] There are no commands defined in the "vendor" namespace
How to solve this.
sir please help me to have method so that i can know that the message are sent or fails so that i can apply callbacks response Example method "Mailgun::failures()"
Mailgun::send('emails.welcome', $data, function ($message) {
$message->to('[email protected]', 'John Smith')->subject('Welcome!');
});
//i am happy if this Mailgun::failures will be added for easy callback response
if (Mailgun::failures()) {
$result['success'] = 'false';
$result['msg'] = 'There was an error while sending the email. Please try again';
}
else {
$result['success'] = 'true';
$result['msg'] = 'Email successfully sent';
}
return $result;
Please update,i am using guzzlehttp 6.x
the address gets sent to everyone, instead of to each individual person.
So, instead of [email protected], and another message to [email protected], it sends one message to [email protected], [email protected]
Is there a way to avoid this? Right now the foreach is inside mailgun, should it be moved out?
While working on the project I use Mailgun for, we've come across a slight issue.
Although Mailgun is a lot faster than using plain old SMTP to send emails, it still induces quite a delay at one stage of the process, basically we need to send custom emails out to (possibly) hundreds of people at one time.
One feature of Mail that this package doesnt replicate is Mail::queue
. It would be super useful if that was able to be implemented. Is this something that would be possible?
Thanks for your work on this so far, it's helped in so many ways!
James
Hi Bogardo,
Thanks for this brilliant tool but I am hoping you could give me an example of how to include a campaign id. I have had a number of attempts but I cannot get it right.
Neither of these work and I'm hoping you can point me in the right direction (I would have asked on the Laravel forum but it is moving and laravel.io isn't working).
$message->data('X-Mailgun-Campaign-Id', "{'o:campaign': '001_invitation_requests'}");
$message->data('o:campaign', '001_invitation_requests');
$message->data('X-Mailgun-Campaign-Id', '001_invitation_requests');
Thanks in advance and Thanks again for the repo.
John
"bogardo/mailgun": "v3.0."
"bogardo/mailgun": "v2."
Should be
"bogardo/mailgun": "3.0."
"bogardo/mailgun": "2."
WebRoot]$ composer update
[UnexpectedValueException]
Could not parse version constraint v3.0.*: Invalid version string "v3.0.*"
With the latest update to the repo, support for laravel 4.0 has been dropped, en because there is no versioning or branches in your project, I am not able to install an earlier version. Can this be fixed?
Hi again :)
There seems to be a bug when multiple emails are sent - in the example code below, the first email is correctly sent to [email protected], but the second email is incorrectly sent to both [email protected] and [email protected]. It should, of course, only be sent to [email protected]
Mailgun::send('emails.test', $data, function($message) {
$message->to('[email protected]', 'Recipient One')->subject('Mailgun Test!');
});
Mailgun::send('emails.test', $data, function($message) {
$message->to('[email protected]', 'Recipient Two')->subject('Mailgun Test!');
});
This is a feature request....would like to request the ability to subscribe and unsubscribe an email address...maybe something like this
Mailgun::subscribe('[email protected]', 'mailing list name')
Mailgun::unsubscribe('[email protected]', 'mailing list name')
Hi Bogardo,
I am trying to send a batch mail to multiple recipients at the same time using below code using Laravel framework.
Mailgun::send('emails.mudrush', $data, function($message) use($users)
{
$message->subject('Last day to WIN free passes to The Mud Rush' );
$message->to($users);
});
If you see $users
array has all the emails of the users. Now the issue is every user is able to see all the other users emails.
But we don't want to visible all the users emails.
Could not parse version constraint v2.: Invalid version string "v2." while composer update. any solution ?
I have used this package several times on a number of projects but this is the first time I am using with Password Reminders.
I followed the instructions given here: http://bogardo.com/mailgun-and-password-reminders/. I had issues with creating a namespace for the two new files but I had that resolved by using the autoload section of composer.json
. Now, when I load the reminder form supply my e-mail address and submit (posts to password/reset), I get the following error and I do not get the password reset e-mail:
Symfony \ Component \ Debug \ Exception \ FatalErrorException (E_ERROR) Class 'Bogardo\Mailgun\MailgunApi' not found Open: ....../vendor/bogardo/mailgun/src/Bogardo/Mailgun/Mailgun.php
In the vendor folder, I can see the MailgunApi class here: Bogardo\Mailgun\Mailgun\MailgunApi. How do I resolve this issue? Let me know if you need more information.
I am using Laravel 4.2
I just noticed they're releasing a new API version, is it compatible?
Hi,
Is there some option for create a campaign in this plugin?
Thanks,
Tom
From the manual: http://documentation.mailgun.com/user_manual.html#batch-sending when batch-sending, Mailgun only knows to send emails to individual recipients (i.e. one recipient in the 'to' field) when you use recipient variables. Batch sending has an advantage over using the Mailgun::send in a loop since there's only one API call with the former therefore less loading time for the user. And then there's the advantage of using the same to personalise the emails.
Could you kindly add this feature?
Great work!
in src/Bogardo/Mailgun/Mailgun.php, line 100
Commented out code reduces readability and lowers the code confidence for other developers. If it's common usage for debug, it should not be committed. Using a version control system, such code can be safely removed.
$this->callMessageBuilder($callback, $this->message);
$this->getMessage($view, $data);
//dd($this->getMessageData());
$this->mailgun()->sendMessage(Config::get('mailgun::domain'), $this->getMessageData(), $this->getAttachmentData());
}
/**
Posted from SensioLabsInsight
Proposed format:
Mailgun::send('emails.welcome', $data, function($message)
{
$message->data('key', 'value');
});
Where the value will be json encoded
I wonder if this package is compatible with Laravel 5.2?
I'm using the batch sending mode and I'd like to fill in certain fields like "First Name", "Title" etc.
The mailgun docs says it's possible by using recipient variables here: http://documentation.mailgun.com/user_manual.html#batch-sending
So far I've tried to use the $message->data('key', 'value') and then %recipient.yourkey% in testing but the values are not filled in.
Has anyone had sucess with this?
Because Mail::raw() is not supported, it is mandatory that a view is passed, but in cases where you rendered the view before to execute some parsing function, like using CSSInline class, you cant just pass the parsed data to Mailgun::send.
Is there a simple way to use this Mailgun HTTP instead of standard Mail in Password Reminders & Reset (http://laravel.com/docs/security#password-reminders-and-reset)?
what code can i use in Mailgun:: to check email sent successfully?
I've same issue. app develop using laravel 4.2, this package installed correctly. I'm working on local environment plan to send emails via mailgun API
Error is :
Mailgun \ Connection \ Exceptions \ MissingEndpoint
The endpoint you've tried to access does not exist. Check your URL.
Domain and API set in services.php
'mailgun' => array(
'domain' => 'sandboxe786b43f2c3447fdaf02258fae929ab8.mailgun.org',
'secret' => 'xxxxxx2833725df29b4ad6bbaadc1d9',)
can you help me to sort it out ?
Mailgun just launched a new email validation service called Guardpost
which provides the following features:
Documentation:
http://documentation.mailgun.com/api-email-validation.html#email-validation
If think this could be a good addition to the Mailgun package.
Proposed syntax:
Mailgun::validate("[email protected]");
Laravel 5.3 is out. =)
I like their new Mailables feature. Mail::to($request->user())->send(new OrderShipped($order));
Mailgun documentation doesn't suggest this is feasible yet. Thought I'd mention it.
Hi,
I am using Laravel 5.2 with the latest version of guzzlehttp/guzzle [6.2.1]. When I try to install bogardo/mailgun, get the following error:
C:\xampp\php\php.exe C:/xampp/htdocs/project-name/composer.phar require bogardo/mailgun:4.0.0 -n --no-progress
./composer.json has been updated
Loading composer repositories with package information
Updating dependencies (including require-dev)
Your requirements could not be resolved to an installable set of packages.Problem 1
- mailgun/mailgun-php v1.8 requires guzzlehttp/guzzle ~5.0 -> satisfiable by guzzlehttp/guzzle[5.0.0, 5.0.1, 5.0.2, 5.0.3, 5.1.0, 5.2.0, 5.3.0, 5.3.1, 5.3.x-dev] but these conflict with your requirements or minimum-stability.
- bogardo/mailgun 4.0.0 requires mailgun/mailgun-php ^1.8 -> satisfiable by mailgun/mailgun-php[v1.8].
- Installation request for bogardo/mailgun 4.0.0 -> satisfiable by bogardo/mailgun[4.0.0].Installation failed, reverting ./composer.json to its original content.
So, it seems that this package doesn't work with the latest version of guzzle... Can I expect this package to work with the latest version of guzzle any time soon, or I need to remove the current version and install 5.3.1?
License "GPL v2" is not a valid SPDX license identifier, see http://www.spdx.org/licenses/ if you use an open license.
If the software is closed-source, you may use "proprietary" as license.
Posted from SensioLabsInsight
When you have time can you help me figure this out? I have installed this properly and now I can't get it to work. Says "Credentials Incorrect". I have published the package, filled out the config.php properly. Have no idea why it is not working.
Any ideas on what I could try?
Instead of creating the message and attachment by hand before sending, switch to using the MessageBuilder class.
I recommend adding one small thing to the configuration, i.e.
Add the following alias to the aliases array in your app/config/app.php file.
'Mailgun' => 'Bogardo\Mailgun\Facades\Mailgun'
It's easier to "use Mailgun" this way. Thanks.
Hi,
With Laravel's Maill class you can send plain text emails like this:
Mailgun::send([], [], function($message) {
});
Is there a way to do this with Mailgun::?
I get a setBody() error atm.
I upgraded to the latest. - Installing bogardo/mailgun (v3.1.2)
Error
Call to undefined method Bogardo\Mailgun\Mailgun\Lists::member()
myCode
$mail = Mailgun::lists()->member("[email protected]", "[email protected]");
print_r($mail);
Also tried
myCode
Mailgun::lists()->members("[email protected]");
Error
Call to undefined method Bogardo\Mailgun\Mailgun\Lists::members()
No idea what is wrong.
I'm using laravel 4.2. I try bellow example, but it does not work. It occur bellow error.
"The parameters passed to the API were invalid. Check your inputs".
=> Code
$data = array(
'customer' => 'John Smith',
'url' => 'http://laravel.com'
);
Mailgun::send('emails.layout', $data, function($message)
{
$message->to('[email protected]', 'John Smith')->subject('Welcome!');
});
=> View file code
Hi {{ $customer }},
Please visit {{ $url }}
Hello,
This is my code:
$to = '[email protected]';
$subject = 'offline';
$html_message = 'test offline';
$data = array(
'customer' => 'John Smith',
'url' => 'http://laravel.com'
);
Mailgun::send('mail', $data, function($message) use ($to,$subject)
{
$message->to($to, 'John Smith')->subject($subject);
});
But it show error which is:
The parameters passed to the API were invalid. Check your inputs!
Can you explain ?
Thank you
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.