uccello / email-history
An Uccello package to log email sent.
v1.1.0
2021-02-09 15:43 UTC
Requires
- uccello/uccello: 1.*|2.*
- dev-master
- v1.1.0
- v1.0.0
- dev-dependabot/npm_and_yarn/json5-1.0.2
- dev-dependabot/npm_and_yarn/express-4.18.2
- dev-dependabot/npm_and_yarn/qs-and-express-6.11.0
- dev-dependabot/npm_and_yarn/decode-uri-component-0.2.2
- dev-dependabot/npm_and_yarn/loader-utils-and-webpack-cli-1.4.2
- dev-dependabot/npm_and_yarn/eventsource-1.1.1
- dev-dependabot/npm_and_yarn/async-2.6.4
- dev-dependabot/npm_and_yarn/url-parse-1.5.10
- dev-dependabot/npm_and_yarn/ajv-6.12.6
- dev-dependabot/npm_and_yarn/path-parse-1.0.7
- dev-dependabot/npm_and_yarn/ws-6.2.2
- dev-dependabot/npm_and_yarn/dns-packet-1.3.4
- dev-dependabot/npm_and_yarn/browserslist-4.16.6
- dev-dependabot/npm_and_yarn/lodash-4.17.21
- dev-dependabot/npm_and_yarn/ssri-6.0.2
- dev-dependabot/npm_and_yarn/y18n-4.0.1
- dev-dependabot/npm_and_yarn/elliptic-6.5.4
- dev-dependabot/npm_and_yarn/dot-prop-4.2.1
- dev-dependabot/npm_and_yarn/axios-0.21.1
- dev-dependabot/npm_and_yarn/ini-1.3.8
- dev-dependabot/npm_and_yarn/http-proxy-1.18.1
- dev-dependabot/npm_and_yarn/websocket-extensions-0.1.4
- dev-dependabot/npm_and_yarn/jquery-3.5.0
- dev-dependabot/npm_and_yarn/acorn-6.4.1
This package is auto-updated.
Last update: 2024-11-05 12:23:40 UTC
README
This package allows you to track with Uccello emails sent.
Installation
Install with composer
composer require uccello/email-history
Publish assets
php artisan vendor:publish --tag=email-history-assets
Usage
Create Related Lists
With a migration, create a Related List to display emails sent related to a record:
php artisan make:migration create_email_history_rl
<?php use Illuminate\Database\Migrations\Migration; use Uccello\Core\Models\Module; use Uccello\Core\Models\Relatedlist; class CreateEmailHistoryRl extends Migration { /** * Run the migrations. * * @return void */ public function up() { $module = Module::where('name', 'account')->first(); // Change 'account' with the source module's name $relatedModule = Module::where('name', 'email')->first(); Relatedlist::create([ 'module_id' => $module->id, 'related_module_id' => $relatedModule->id, 'related_field_id' => $relatedModule->fields->where('name', 'entity')->first()->id, 'tab_id' => null, 'label' => 'relatedlist.emails', 'type' => 'n-1', 'method' => 'getDependentList', 'sequence' => $module->relatedlists()->count(), 'data' => null ]); } /** * Reverse the migrations. * * @return void */ public function down() { $module = Module::where('name', 'account')->first(); // Change 'account' with the source module's name $relatedModule = Module::where('name', 'email')->first(); Relatedlist::where('module_id', $module->id) ->where('related_module_id', $relatedModule->id) ->where('label', 'relatedlist.emails') ->delete(); } }
Helper
A helper allows you to add easily a new email and link it to a record.
<?php use Uccello\EmailHistory\Facades\EmailHistory; // Use function params EmailHistory::add( $domain, // Current domain $record->uuid, // Record uuid 'Hi everyone!', // Email subject 'A beautiful email to remember install this package', // Email body 'friends@uccello.io', // To Carbon::now(), // Sent at - optional [ // An array with all attachments (File name => File path in storage) - optional "File1.pdf" => "uccello/files/zPODV1l0WF4wEJsad7xHsX6G7D7Cu004AEKjDSkd.pdf", "File2.pdf" => "uccello/files/zPODV1l0WF4wEJsad7xHsX6G7D7Cu004AEKjDSkd.pdf" ], 'other_friends@uccello.io', // Cc - optional 'hidden_friends@uccello.io' // Bcc - optional ); // Use array EmailHistory::addWithArray([ 'subject' => $subject, 'body' => $body, 'sent_at' => $sentAt, // Optional 'to' => $to, 'cc' => $cc, // Optional 'bcc' => $bcc, // Optional 'attachment' => $attachment, // Optional 'domain_id' => $domain->id, 'entity' => $entity_uuid ])