User1980's avatar

How to attach different files via emails?

Hi all,

I wonder which logic would you use to attach different files via emails please.

The user may attach jpeg,png or pdf to my form. I found this example:


        return $this->view('emails.myDemoMail')
                    ->attach(public_path('pdf/sample.pdf'), [
                         'as' => 'sample.pdf',
                         'mime' => 'application/pdf',
                    ]);

How would you, in this case, allow multiple attachments as well as mimes please?

Thanks

0 likes
3 replies
User1980's avatar

Do you know if there is a "if" type of logic for this as sometime a user may or may not attach one of these types of files(or may not attach any at all). Thanks.

3 likes

Please or to participate in this conversation.