Skip to content

Repository files navigation

Barua Banner
Barua

The next generation of writing emails.
High-quality, un-styled components for creating emails.


Table of Contents

  1. Introduction
  2. Getting Started
  3. Email Components
  4. License
  5. Changelog
  6. Contributing
  7. Security
  8. Support
  9. Contributors
  10. Authors
  11. License


Introduction

The purpose of this package is to offer convenient mechanisms for creating and sending responsive and visually appealing emails. It includes un-styled components at its core, allowing for more tailored and personalized design customization.


Getting Started

This section will walk you through the initial setup and basic usage of this package, ensuring you can quickly begin creating and sending responsive emails with the available fluent API and customizable components.


Prerequisites

Before installing this package, make sure that your system meets the following requirements:

  • PHP >= 8.2 (or newer) installed on your system.
  • Laravel 9.x or newer installed on your system.
  • Composer for managing dependencies.

Installation and Configuration

  1. Install the Package via Composer

To install the package, run the following command in your Laravel project directory:

composer require --dev laranail/barua
  1. Publish package files (Optional)

Run the following commands to publish the package assets, configuration, and template files to your Laravel application for further customization.

a. Publish package Service Provider

php artisan vendor:publish --provider=Simtabi\Laranail\Barua\Providers\BaruaServiceProvider // to publish the service provider

b. Publish specific files using the following tags per your needs:

php artisan vendor:publish --tag=barua::blade-component-classes     // to copy blade component classes            
php artisan vendor:publish --tag=barua::blade-components            // to copy blade components view files                         
php artisan vendor:publish --tag=barua::blade-templates             // to copy all blade template files                           
php artisan vendor:publish --tag=barua::config                      // to copy config files                                    
php artisan vendor:publish --tag=barua::lang                        // to copy lang files                      
php artisan vendor:publish --tag=barua::mail-template-classes       // to copy mail template classes to the default app/Mail directory                       
php artisan vendor:publish --tag=barua::public-assets               // to copy public assets files to the public directory

Alternatively, you can manually copy the files yourself to your Laravel application.

/config/* 
/database/*
/resources/assets/*
/resource/lang/*
/resources/views/*
/src/Mail/Templates/*

Configuration

Optionally, add the following configuration options to change the package's default behavior:

  1. Environment Configuration
# this option exposes the package's default routes for testing purposes
 BARUA_ENABLE_DEV_MODE=true
# this option enables the package to throw exceptions when errors occur
 BARUA_ENABLE_ERROR_THROWING=true
# this option sets the maximum file size for attachments
 BARUA_MAX_FILE_SIZE="5mb"
# this option sets the allowed MIME types for attachments
 BARUA_ALLOWED_MIME_TYPES="application/pdf,image/jpeg,image/png,"
  1. Package You can publish the package configuration file located at config/barua.php to make changes to the default settings.

  2. Language You can publish the package language file located at /resources/lang/en/barua.php to make changes to the default language values.

  3. Mail The application will use the default Laravel mail configuration settings to send emails, as you have already set up in your Laravel application's environment file or as stored in the database.

'from' => [
    'email' => env('MAIL_FROM_ADDRESS', 'hello@example.com'),
    'name'   => env('MAIL_FROM_NAME', 'Example'),
],
  1. View Templates & Components The package comes with a collection of Blade components that are un-styled by default, enabling you to design your email templates from scratch. If you prefer, you can also utilize your own pre-made HTML templates.

These Blade components, supplied by the package, are designed to be both responsive and customizable, facilitating the creation of attractive emails. These components can be employed to create a range of email templates, from straightforward text-based messages to more intricate layouts incorporating images and links.

You can find these components in the resources/views/emails or resources/views/vendor/barua directories once they've been published, and they can be easily tailored to meet your requirements.

You're encouraged to modify the provided templates/components to align with your specific needs, including any particular commands, configuration specifics, or features that should be made known to users from the outset.


Compatibility

All blade components were tested and found to be compatible with the following email clients:

Gmail logo Apple Mail Outlook logo Yahoo! Mail logo HEY logo Superhuman logo
Gmail ✔ Apple Mail ✔ Outlook ✔ Yahoo! Mail ✔ HEY ✔ Superhuman ✔

Development

Install dependencies

composer install

Tests

composer ci


Changelog

Please see CHANGELOG for more information on what has changed recently.

Contributing

Please see CONTRIBUTING for details.

Security

Please see SECURITY for details.

Support

Please see Support and Community for details.

Contributors

Please see CONTRIBUTORS for details.

Authors

License

Open-sourced software licensed under the MIT license. Please see LICENSE for details.

About

Effortlessly design and send stunning, responsive emails with customizable components.

Resources

Code of conduct

Contributing

Security policy

Stars

0 stars

Watchers

1 watching

Forks

Releases

Sponsor this project

Packages

Used by

Contributors

Languages