Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SparkPost doesn't send attachments #13546

Closed
bobbybouwmann opened this issue May 13, 2016 · 7 comments
Closed

SparkPost doesn't send attachments #13546

bobbybouwmann opened this issue May 13, 2016 · 7 comments
Labels

Comments

@bobbybouwmann
Copy link
Contributor

bobbybouwmann commented May 13, 2016

Hi,

As many other developers I migrated my application from Mandrill to SparkPost. Never had any issues with Mandrill, but I can' t send attachments.

I have a bit of example code here, but that is straight forward with Laravel. This does work with Mandrill, Mailgun, and the SMTP drivers. However SparkPost send the email, but forgets the attachments.

Route::get('test/mail', function () {
        Mail::send('emails.test', [], function ($message) {
        $message->to('[email protected]')
            ->subject('Test mail')
            ->attach(storage_path('files') . '/' . 'somefile.pdf', ['as' => 'Some File']);
    });

    return 'Done';
});

I also have a support ticket open at SparkPost, but this can be an issue with Laravel or SparkPost...

Is this a known issue?

@bobbybouwmann bobbybouwmann changed the title SparkPost doesn't send attachments when sending mails SparkPost doesn't send attachments May 15, 2016
@Nekudapsik
Copy link

Nekudapsik commented May 15, 2016

New laravel version (5.2.31) and especially this commit 3d9e502 broke SparkPost driver ability to send attachments. I reverted the changes to old version:

                'content' => [
                    'email_rfc822' => $message->toString(),
                    // 'html' => $message->getBody(),
                    // 'from' => $this->getFrom($message),
                    // 'subject' => $message->getSubject(),
                ],

and it worked well.

My workaround for now is to rollback to previous version of laravel framework

composer require "laravel/framework:5.2.30"

@GrahamCampbell
Copy link
Member

@taylorotwell

@bobbybouwmann
Copy link
Contributor Author

@Nekudapsik This indeed fixes the issue for now. I will look into this when I have some free time today ;)

@taylorotwell
Copy link
Member

I don't use SparkPost. I will need the community to maintain that driver by sending a PR to fix the issues.

@bobbybouwmann
Copy link
Contributor Author

@taylorotwell This #13237 PR seems to break the functionality for attachments. I think the best way right now is to revert the changes so it doesn't break current installations and then we can look into a new implementation. What do you think?

@billmn
Copy link
Contributor

billmn commented May 16, 2016

I'll take a look ...

taylorotwell pushed a commit that referenced this issue May 17, 2016
* [5.2] Fix SparkPost doesn't send attachments #13546

* CS Fix
@tillkruss
Copy link
Contributor

This can be closed now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

6 participants