# Installation

You can install the base package via Composer (opens new window):

composer require dniccum/custom-email-sender

# Publish Assets

You will then need to publish the package's configuration and blade view files to your applications installation:

php artisan vendor:publish --provider="Dniccum\CustomEmailSender\ToolServiceProvider"

If you would only like to publish a portion of the vendor assets, you may use the following tags:

  • config
  • views
  • lang

with the necessary artisan command like so:

php artisan vendor:publish --provider="Dniccum\CustomEmailSender\ToolServiceProvider" --tag=config

Inside App\Providers\NovaServiceProvider update the tools function. This will include the link on the sidebar.

use Dniccum\CustomEmailSender\CustomEmailSender;

...

public function tools()
{
    return [new CustomEmailSender()];
}

# Migrating from version 1.X

If you are upgrading from version 1.X AND you have modified the tool's default configuration, some please note the changes made to the 'from' property and update your configuration file accordingly.

# Send From settings

Below the is the "out-of-the-box" configuration for the 'from' setting:

'from' => [
    'default' => config('mail.from.address'),
    'options' => [
        [
            'address' => config('mail.from.address'),
            'name' => config('mail.from.name'),
        ]
    ],
],

If you have a custom from address and name, add them as an associative array to the 'options' array, and indicate the default as you see fit.

# Models

You can now send emails to multiple models instead of singular model like before.

'model' => [
    'classes' => [
        \App\Models\User::class,
    ],
    'email' => 'email',
    'name' => null,
    'first_name' => 'first_name',
    'last_name' => 'last_name',
]
  1. The 'class' value within the 'model' configuration is no longer used.
  2. A new 'classes' value has taken it's place and accepts an array of Eloquent model classes to be passed to it.
  3. Define the corresponding columns that the tool will use to extract information from your application's models.

# Migrating from version 2.X

If you are upgrading from version 2.X AND you plan on using the Nebula Sender (opens new window) service to enhance this tool, add the following code to your novaemailsender.php file:

/*
|--------------------------------------------------------------------------
| Nebula Sender
|--------------------------------------------------------------------------
|
| Nebula Sender is a service that will allow you to save/edit sent messages as
| well as message drafts. For more information, visit: https://nebulasender.com
|
*/
'nebula_sender' => [

    /*
    |--------------------------------------------------------------------------
    | Nebula Sender Key
    |--------------------------------------------------------------------------
    |
    | If you are subscribing to Nebula Sender, provide your application key
    | below to utilize these features.
    |
    */
    'key' => env('NEBULA_SENDER_KEY'),

    /*
    |--------------------------------------------------------------------------
    | Timezone
    |--------------------------------------------------------------------------
    |
    | The Timezone should the application use to parse it's dates
    |
    */
    'timezone' => env('NEBULA_SENDER_TIMEZONE', config('app.timezone')),

    /*
    |--------------------------------------------------------------------------
    | Timezone
    |--------------------------------------------------------------------------
    |
    | The Moment.js date formatting that will be used to display dates. Refer to the
    | Moment.js documentation for further details: https://momentjs.com/docs/#/displaying/
    |
    */
    'date_format' => env('NEBULA_SENDER_DATE_FORMAT', 'MMM D, YYYY \a\t h:mm A'),
],