Coder Social home page Coder Social logo

mailhub's Introduction

#MailHub

Build Status Latest Stable Version Total Downloads Latest Unstable Version License


Language: Chinese

MailHub is an email package for Laravel.

It integrates third-party email services with Laravel's SwiftMail, providing a unified protocol for email routines. A rule engine is employed to post emails to different domains by corresponding senders.

  • Provides elegant email interface instead of SwiftMail
  • Connects to third-party email services beyond SwiftMail
  • Currently implements email sending by SendCloud
  • Tags and queues planned in next versions
  • Discussions and PRs are welcome

##How to install:

# The introduction of dependent libraries
composer require mrvokia/mailhub:"dev-master@dev" -vvv

# Added service provider in the providers
MrVokia\MailHub\MailHubServiceProvider::class

# Add the aliases facade
'MailHub' => MrVokia\MailHub\MailHubFacade::class

# Composer auto load
composer dump

# Push Profile mailhub
php artisan vendor:publish

##How to use:

use MrVokia\MailHub\MailHub;

/**
 * Send mail
 */
public function example(MailHub $mailhub)
{
	$mailhub->send()
        	->to(['[email protected]', '[email protected]'])
        	->cc(['[email protected]'])
        	->subject('example')
        	->html('example content')
        	->start()
	//or
	MailHub::send()
			->to(['[email protected]', '[email protected]'])
			->cc(['[email protected]'])
			->subject('example')
			->html('example content')
			->start()
}

/**
 * Send template mail
 */
public function exampleTemplate(MailHub $mailhub)
{
	$mailhub->send()
        	->to(['[email protected]', '[email protected]'])
        	->subject('example')
        	->xsmtpapi([
				'active' => ['test', 'test2']
			])
        	->templateInvokeName('mail.register')
        	->start()
	//or
	MailHub::send()
       		->to(['[email protected]', '[email protected]'])
       		->cc(['[email protected]'])
       		->subject('example')
        	->xsmtpapi([
				'active' => ['test', 'test2']
			])
        	->templateInvokeName('mail.register')
       		->start()
}

##Params:

params defaule other description
gateway '' swiftmail / sendcloud Specifies the gateway to send
async false true Specify whether third-party mail (SendCloud) needs to use async send, reduce client response time after opening
env false true Specifies whether to display APP_ENV at the bottom of the message template. When enabled, add the { {{$ env or ''}} `` to the current APP_ENV name in the mail template (to keep the production environment clean, APP_ENV = product will not be shown)
pretend false true Specify whether to intercept the message, so that the message sent to the specified mailbox, mail address in the mailhub configuration file `mail_testname configuration
queue false true Specify whether to enable SMTP mail queues. Refer to the Laravel documentation for queue configuration
queueTarget mailer '' Specifies the SMTP mail queue pipe name

##Thx

mailhub's People

Contributors

mrvokia avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

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.