Giter Club home page Giter Club logo

laravelelasticemail's Introduction

Laravel Elastic Email

A Laravel wrapper for Elastic Email

Can send emails with multiple attachments

IMPORTANT

Laravel version

5.5 or older - Use Version 1.1.1

5.6 and forwards - Use version 1.2

Installation

  • Step 1

Install package via composer

composer require rdanusha/laravel-elastic-email
  • Step 2

Add this code to .env file

ELASTIC_ACCOUNT=<Add your account>
ELASTIC_KEY=<Add your key>
  • Step 3

Update MAIL_DRIVER value as 'elastic_email' in your .env file

MAIL_DRIVER=elastic_email
  • Step 4

Add this code to your config/services.php file

'elastic_email' => [
	'key' => env('ELASTIC_KEY'),
	'account' => env('ELASTIC_ACCOUNT')
]
  • Step 5

Open config/app.php file and go to providers array, Then comment out Laravel's default MailServiceProvider and add the following

'providers' => [
    /*
     * Laravel Framework Service Providers...
     */
    ...
//    Illuminate\Mail\MailServiceProvider::class,
    Rdanusha\LaravelElasticEmail\LaravelElasticEmailServiceProvider::class,
    ...
],

Usage

This package works exactly like Laravel's native mailers. Refer to Laravel's Mail documentation.

https://laravel.com/docs/5.5/mail

Code Example

Mail::to($request->user())->send(new OrderShipped($order));

laravelelasticemail's People

Contributors

janva255 avatar rdanusha avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

laravelelasticemail's Issues

Attachments are not being sent

Hello.

I'm trying to send attachments with e-mail, but are not being sended.
The email never comes, it's just to test.
If attachments are not send, the email arrives

Here is my code in App\Mail\OrderShipped.

<?php

namespace App\Mail;

use Illuminate\Bus\Queueable;
use Illuminate\Mail\Mailable;
use Illuminate\Queue\SerializesModels;
use Illuminate\Contracts\Queue\ShouldQueue;
use function GuzzleHttp\Psr7\mimetype_from_filename;

class OrderShipped extends Mailable
{
    use Queueable, SerializesModels;

    protected $config;

    /**
     * Create a new message instance.
     *
     * @return void
     */
    public function __construct($config)
    {
        $this->config = $config;
    }

    /**
     * Build the message.
     *
     * @return $this
     */
    public function build()
    {
        $attachments = json_decode($this->config['attachments']);
        return $this->view('welcome')
            ->attach($attachments[0]->path, [
                'as' => $attachments[0]->name,
                'mime' => mimetype_from_filename($attachments[0]->path)
            ]);
    }
}

Thanks.

How to get the messageId?

Can I retrieve the messageId of the email?
I need this to use it in the /v2/email/status to know if the email was opened.

Thanks

Support for Laravel 8 please

Hi,
I want this package to use with laravel 8 but I am unable to install this, Could you please add support for laravel 8?
Thanks,

Swift_Mime_Message problem

Declaration of Rdanusha\LaravelElasticEmail\ElasticTransport::send(Swift_Mime_Message $message, &$failedRecipients = NULL) must be compatible with Swift_Transport::send(Swift_Mime_SimpleMessage $message, &$failedRecipients = NULL)

cant installed on laravel 5.5

hello sir, are this package available for laravel 5.5?
cause i install it on laravel 5.5 and error message showed up

 Problem 1
    - Installation request for rdanusha/laravel-elastic-email ^1.0 -> satisfiable by rdanusha/laravel-elastic-email[v1.0].
    - rdanusha/laravel-elastic-email v1.0 requires laravel/framework 5.4.x -> no matching package found.

Potential causes:
 - A typo in the package name
 - The package is not available in a stable-enough version according to your minimum-stability setting
   see <https://getcomposer.org/doc/04-schema.md#minimum-stability> for more details.

Read <https://getcomposer.org/doc/articles/troubleshooting.md> for further common problems.

Thankyou

v1.1.2 tag

Having dev-master for installing dependencies is not ideal. And I'm surprised that the repo is last updated 8 months ago without the v1.1.2 tag.

Error show

Call to undefined method Swift_MimePart::get File name() in ElasticTransport.php (line 122)
how to resolve this issue?

v1.1.2 doesn't support 5.4

Hi developers!

Today i make a composer update on my laravel 5.4 and this update the package to v1.1.2

Declaration of Rdanusha\LaravelElasticEmail\ElasticTransport::send() must be compatible with Swift_Transport::send(Swift_Mime_Message $message, &$failedRecipients = NULL)

To fix it, i use v1.1.1!

Please, add a message on README.md

Use v.1.0.0 tag if you have Laravel 5.4

Thanks dude!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.