{"id":16668352,"url":"https://github.com/tomirons/tuxedo","last_synced_at":"2025-05-08T19:37:51.946Z","repository":{"id":54296416,"uuid":"73421674","full_name":"tomirons/tuxedo","owner":"tomirons","description":"Simple transactional email classes/templates for Laravel 5 mailables","archived":false,"fork":false,"pushed_at":"2021-02-26T00:54:30.000Z","size":128,"stargazers_count":94,"open_issues_count":0,"forks_count":5,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-11-09T19:22:37.058Z","etag":null,"topics":["laravel","php","tuxedo"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tomirons.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-11-10T21:19:03.000Z","updated_at":"2023-11-11T12:48:10.000Z","dependencies_parsed_at":"2022-08-13T11:20:15.931Z","dependency_job_id":null,"html_url":"https://github.com/tomirons/tuxedo","commit_stats":null,"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tomirons%2Ftuxedo","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tomirons%2Ftuxedo/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tomirons%2Ftuxedo/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tomirons%2Ftuxedo/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tomirons","download_url":"https://codeload.github.com/tomirons/tuxedo/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":225110575,"owners_count":17422411,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["laravel","php","tuxedo"],"created_at":"2024-10-12T11:24:42.697Z","updated_at":"2024-11-18T01:04:45.046Z","avatar_url":"https://github.com/tomirons.png","language":"PHP","funding_links":[],"categories":["Packages"],"sub_categories":["Helpers/General"],"readme":"# Tuxedo\n[![Version](https://img.shields.io/packagist/v/tomirons/tuxedo.svg)](https://packagist.org/packages/tomirons/tuxedo)\n[![License](https://poser.pugx.org/tomirons/tuxedo/license.svg)](https://packagist.org/packages/tomirons/tuxedo)\n[![Total Downloads](https://img.shields.io/packagist/dt/tomirons/tuxedo.svg)](https://packagist.org/packages/tomirons/tuxedo)\n[![Build Status](https://travis-ci.org/tomirons/tuxedo.svg?branch=master)](https://travis-ci.org/tomirons/tuxedo)\n\nTuxedo is an easy way to send transactional emails with Laravel's `Mail` classes, with the templates already done for you.\n\n## Contents\n\n- [Installation](#installation)\n- [Classes](#classes)\n    - [ActionMailable](#actionmailable)\n    - [AlertMailable](#alertmailable)\n    - [InvoiceMailable](#invoicemailable)\n- [License](#license)\n\n## Installation\n1) Run the following command:\n\n````shell\n$ composer require tomirons/tuxedo\n````\n    \n2) Open your `config/app.php` and add the following class to your `providers` array:\n\n````php\nTomIrons\\Tuxedo\\TuxedoServiceProvider::class\n````\n    \n3) (Optional) If you would like to edit the templates, run the following command to publish them\n\n````shell\nphp artisan vendor:publish --provider=TomIrons\\Tuxedo\\TuxedoServiceProvider\n````\n\n## Classes\nThere are currently 3 different types of classes you can extend. `ActionMailable`, `AlertMailable`, and `InvoiceMailable`, and each have their own special properties and methods.\n\n#### Global Methods\nThese methods are available in **ALL** classes.\n- `greeting($greeting)` - Sets the greeting for the message.\n- `salutation($salutation)` - Sets the salutation for the message.\n- `line($line)` - Add a line of text to the message.\n  \n### ActionMailable\n\n#### Methods\n- `color($color)` - Sets the color of the button. Available options are `blue`, `green`, and `red`.\n- `action($text, $url)` - Sets the button text and url.\n- `success()` - Sets the button color to `green`.\n- `error()` - Sets the button color to `red`.\n- `info()` - Sets the button color to `blue`.\n  \n#### Example\n````php\n\u003c?php\n\nnamespace App\\Mail;\n\nuse Illuminate\\Bus\\Queueable;\nuse Illuminate\\Queue\\SerializesModels;\nuse Illuminate\\Contracts\\Queue\\ShouldQueue;\nuse TomIrons\\Tuxedo\\Mailables\\ActionMailable;\n\nclass ActionMail extends ActionMailable\n{\n    use Queueable, SerializesModels;\n\n    /**\n     * Create a new message instance.\n     *\n     * @return void\n     */\n    public function __construct()\n    {\n        //\n    }\n\n    /**\n     * Build the message.\n     *\n     * @return $this\n     */\n    public function build()\n    {\n        return $this-\u003egreeting('Hello!')\n                    -\u003eline('Some line of text to tell you what exactly is going on.')\n                    -\u003eaction('Click here to do something fun', url('/'))\n                    -\u003eline('Some other information to be displayed after the button.')\n                    -\u003esalutation('Regards, Example App');\n    }\n}\n````\n\n#### Screenshot\n![Action](https://i.imgur.com/1VHPO0c.png)\n\n### AlertMailable\n\n#### Methods\n- `info()` - Sets the type of the alert to `info`.\n- `warning()` - Sets the type of the alert to `warning`.\n- `success()` - Sets the type of the alert to `success`.\n- `error()` - Sets the type of the alert to `error`.\n- `type($type)` - Sets the type of alert, options are `info`, `success`, `warning`, and `error`.\n- `message($message)` - Sets the message to display in the alert.\n\n#### Example\n````php\n\u003c?php\n\nnamespace App\\Mail;\n\nuse Illuminate\\Bus\\Queueable;\nuse Illuminate\\Queue\\SerializesModels;\nuse Illuminate\\Contracts\\Queue\\ShouldQueue;\nuse TomIrons\\Tuxedo\\Mailables\\AlertMailable;\n\nclass AlertMail extends AlertMailable\n{\n    use Queueable, SerializesModels;\n\n    /**\n     * Create a new message instance.\n     *\n     * @return void\n     */\n    public function __construct()\n    {\n        //\n    }\n\n    /**\n     * Build the message.\n     *\n     * @return $this\n     */\n    public function build()\n    {\n        return $this-\u003egreeting('Hello!')\n                    -\u003einfo()\n                    -\u003emessage('Some text goes here to inform the user')\n                    -\u003eline('Some line of text to tell you what exactly is going on.')\n                    -\u003esalutation('Regards, Example App');\n    }\n}\n````\n\n#### Screenshot\n![Alert](https://i.imgur.com/ckOLIxT.png)\n\n### InvoiceMailable\n\n#### Properties\n- `$keys|array` - Set which keys to use when looking for an item's name and price.\n\n#### Methods\n- `id($id)` - Sets the invoice ID.\n- `date($date)` - Sets the date to display at the top of the invoice table.\n- `due($date)` - Sets the due date of the invoice.\n- `items($items)` - Add an list of items to the invoice. Acceptable variable types are `Collection` and `array`.\n- `calculate($taxPercent, $shipping)` - Calculates the tax and final total, **MUST** be called after items have been added.\n\n#### Example\n````php\n\u003c?php\n\nnamespace App\\Mail;\n\nuse Carbon\\Carbon;\nuse Illuminate\\Bus\\Queueable;\nuse Illuminate\\Queue\\SerializesModels;\nuse Illuminate\\Contracts\\Queue\\ShouldQueue;\nuse TomIrons\\Tuxedo\\Mailables\\InvoiceMailable;\n\nclass InvoiceMail extends InvoiceMailable\n{\n    use Queueable, SerializesModels;\n\n    /**\n     * Create a new message instance.\n     *\n     * @return void\n     */\n    public function __construct()\n    {\n        //\n    }\n\n    /**\n     * Build the message.\n     *\n     * @return $this\n     */\n    public function build()\n    {\n        return $this-\u003eid(123456)\n                    -\u003egreeting('Hi John Doe!')\n                    -\u003edate(Carbon::now()-\u003eformat('l, M j Y \\a\\t g:i a'))\n                    -\u003edue(Carbon::now()-\u003eaddDays(7)-\u003eformat('l, M j Y \\a\\t g:i a'))\n                    -\u003eaction('Click me to pay', url('/'))\n                    -\u003eitems([\n                        ['product_name' =\u003e 'Example Product', 'product_price' =\u003e 123.99],\n                        ['product_name' =\u003e 'Second Product', 'product_price' =\u003e 321.99]\n                    ])\n                    -\u003ecalculate(3, 15)\n                    -\u003esalutation('Regards, Example App');\n    }\n}\n````\n\n#### Screenshot\n![Invoice](https://i.imgur.com/d5S8gJl.png)\n\n## License\nTuxedo is open-sourced software licensed under the [MIT license](http://opensource.org/licenses/MIT)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftomirons%2Ftuxedo","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftomirons%2Ftuxedo","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftomirons%2Ftuxedo/lists"}