PHP Class Bogardo\Mailgun\Mail\Mailer

Show file Open project: bogardo/mailgun Class Usage Examples

Protected Properties

Property Type Description
$config Illuminate\Contracts\Config\Repository
$mailgun Mailgun\Mailgun
$message Message
$view Illuminate\Contracts\View\Factory

Public Methods

Method Description
__construct ( Mailgun $mailgun, Illuminate\Contracts\View\Factory $view, Illuminate\Contracts\Config\Repository $config )
later ( integer | array | DateTime | Carbon\Carbon $time, string | array $view, array $data, Closure $callback ) : Response
send ( string | array $view, array $data, Closure $callback, null $message = null ) : Response

Protected Methods

Method Description
callMessageBuilder ( Closure $callback, Message $message ) : mixed Call the provided message builder.
renderBody ( string | array $view, array $data ) Render HTML and/or text body.
renderView ( string $view, array $data ) : string Render the view.
setHtmlBody ( string $view, array $data ) Set rendered HTML body.
setRawBody ( string $view ) Set the raw body
setTextBody ( string $view, array $data ) Set rendered text body.

Private Methods

Method Description
parseTime ( integer | array | Carbon\Carbon | DateTime $time ) : string Parse given time and convert it to the required format

Method Details

__construct() public method

public __construct ( Mailgun $mailgun, Illuminate\Contracts\View\Factory $view, Illuminate\Contracts\Config\Repository $config )
$mailgun Mailgun\Mailgun
$view Illuminate\Contracts\View\Factory
$config Illuminate\Contracts\Config\Repository

callMessageBuilder() protected method

Call the provided message builder.
protected callMessageBuilder ( Closure $callback, Message $message ) : mixed
$callback Closure
$message Message
return mixed

later() public method

public later ( integer | array | DateTime | Carbon\Carbon $time, string | array $view, array $data, Closure $callback ) : Response
$time integer | array | DateTime | Carbon\Carbon
$view string | array
$data array
$callback Closure
return Bogardo\Mailgun\Http\Response

renderBody() protected method

When only a string is passed as the view we default to an HTML body. When an array without keys is passed as the view; the first value will be handled as the HTML body. An optional second value will be handled as the text body. When an array with keys (html, text or raw) is passed as the view; the values for those keys will be handled according to the key.
protected renderBody ( string | array $view, array $data )
$view string | array
$data array

renderView() protected method

Render the view.
protected renderView ( string $view, array $data ) : string
$view string
$data array
return string

send() public method

public send ( string | array $view, array $data, Closure $callback, null $message = null ) : Response
$view string | array
$data array
$callback Closure
$message null
return Bogardo\Mailgun\Http\Response

setHtmlBody() protected method

Set rendered HTML body.
protected setHtmlBody ( string $view, array $data )
$view string
$data array

setRawBody() protected method

Set the raw body
protected setRawBody ( string $view )
$view string

setTextBody() protected method

Set rendered text body.
protected setTextBody ( string $view, array $data )
$view string
$data array

Property Details

$config protected property

protected Repository,Illuminate\Contracts\Config $config
return Illuminate\Contracts\Config\Repository

$mailgun protected property

protected Mailgun,Mailgun $mailgun
return Mailgun\Mailgun

$message protected property

protected Message,Bogardo\Mailgun\Mail $message
return Message

$view protected property

protected Factory,Illuminate\Contracts\View $view
return Illuminate\Contracts\View\Factory