Closed muzammilaskari closed 3 years ago
Reopening pending new minor release.
Hi, Can you please share code snippest which shows how to add attachments to the email?
Currently I am using this coe
$elasticEmail->email()->send([ 'to' => $recipient, 'subject' => $request->subject, 'body' => $request->description, 'from' => env('ADVERTISING_MAIL_FROM_ADDRESS') ]);
Thanks for highlighting this feature @muzammilaskari
Upgrade your version to latest release v2.2.0
. This includes said feature.
Example usage, taken from integration tests
$subject = "elasticemail-php: Integration test: validate email "
. "attachment send.";
$attachments = [
__DIR__ . '/alpha-attachment.txt',
__DIR__ . '/beta-attachment.txt'
];
$elasticEmail = new ElasticEmail($_ENV['ELASTIC_EMAIL_API_KEY']);
$response = $elasticEmail->email()->send([
'to' => $_ENV['TEST_EMAIL_TO'],
'from' => $_ENV['TEST_EMAIL_FROM'],
'subject' => $subject,
'bodyText' => 'Wake up Samurai!',
], $attachments);
Ah - Thanks man You saved my day Cheers
Thanks for using this package; please feel free to point any bugs/additional high used features to enable from the ElasicEmail API.
Hi, I am working with your package, and it works great, but I need to know how do I attach an attachment to the email which I am sending, Your quick response will be highly appriciated. Thanks,