-
Docs
Backend
-
Behaviors
-
Classes
-
Controllers
-
Database
-
Seeds
-
-
Facades
-
FormWidgets
-
Helpers
-
Exception
- Backend
-
-
Models
-
ReportWidgets
-
Skins
-
Traits
-
Widgets
- ServiceProvider
-
-
Cms
-
Classes
- Asset
- AutoDatasource
- CmsCompoundObject
- CmsController
- CmsException
- CmsObject
- CmsObjectCollection
- CodeBase
- CodeParser
- ComponentBase
- ComponentHelpers
- ComponentManager
- ComponentPartial
- Content
- Controller
- Layout
- LayoutCode
- MediaLibrary
- MediaLibraryItem
- MediaViewHelper
- Meta
- ObjectMemoryCache
- Page
- PageCode
- Partial
- PartialCode
- PartialStack
- Router
- Theme
- ThemeManager
-
Components
-
Contracts
-
Controllers
-
Facades
-
FormWidgets
-
Helpers
-
Models
-
ReportWidgets
-
Traits
-
Twig
- ComponentNode
- ComponentTokenParser
- ContentNode
- ContentTokenParser
- DebugExtension
- DefaultNode
- DefaultTokenParser
- Extension
- FlashNode
- FlashTokenParser
- FrameworkNode
- FrameworkTokenParser
- Loader
- PageNode
- PageTokenParser
- PartialNode
- PartialTokenParser
- PlaceholderNode
- PlaceholderTokenParser
- PutNode
- PutTokenParser
- ScriptsNode
- ScriptsTokenParser
- StylesNode
- StylesTokenParser
-
Widgets
- ServiceProvider
-
-
System
-
Behaviors
-
Classes
-
Console
-
Controllers
-
Database
-
Helpers
-
Models
-
ReportWidgets
-
Traits
-
Twig
- ServiceProvider
-
-
Events
-
backend
-
ajax
-
filter
-
form
-
list
-
menu
-
page
-
user
-
-
cms
-
ajax
-
block
-
combiner
-
component
-
object
-
page
-
router
-
template
-
theme
-
-
halcyon
-
datasource
-
-
mailer
-
media
-
model
-
system
-
assets
-
console
-
mirror
-
theme
-
-
reportwidgets
-
settings
- extendConfigFile
-
-
translator
-
-
Library
-
Argon
-
Auth
-
Models
- AuthException
- Manager
-
-
Config
-
Cookie
-
Middleware
-
-
Database
-
Attach
-
Behaviors
-
Concerns
-
Connections
-
Connectors
-
Models
-
Relations
-
Schema
-
Traits
-
Updates
- README
- Builder
- Collection
- DatabaseServiceProvider
- DataFeed
- Dongle
- MemoryCache
- Model
- ModelBehavior
- ModelException
- NestedTreeScope
- Pivot
- QueryBuilder
- SortableScope
- TreeCollection
- Updater
-
-
Events
-
Exception
-
Extension
-
Filesystem
-
Flash
-
Foundation
-
Bootstrap
-
Console
-
Exception
-
Http
-
Middleware
- Kernel
-
-
Providers
- Application
- Maker
-
-
Halcyon
-
Datasource
-
Exception
-
Processors
-
Traits
- README
- Builder
- Collection
- HalcyonServiceProvider
- MemoryCacheManager
- MemoryRepository
- Model
-
-
Html
-
Mail
-
Network
-
Parse
-
Router
-
Scaffold
-
Support
-
Translation
-
- Documentation
- API
- System
- Classes
- MailManager
System\Classes\MailManager
Source: ~/modules/system/classes/MailManager.php
This class manages Mail sending functions
Protected properties
protected array $callbacks
Cache of registration callbacks.
protected array $templateCache
A cache of customised mail templates.
protected array $registeredTemplates
List of registered templates in the system
protected array $registeredPartials
List of registered partials in the system
protected array $registeredLayouts
List of registered layouts in the system
protected bool $isHtmlRenderMode
Internal marker for rendering mode
protected bool $isTwigStarted
Internal marker for booting custom twig extensions.
protected static $instance
Public methods
public void __clone()
public void __wakeup()
public bool addContentToMailer(Illuminate\Mail\Message $message, string $code, array $data, bool $plainOnly=false)
This function hijacks the addContent
method of the [October\Rain\Mail\Mailer](/docs/api/october/rain/mail/mailer)
class, using the [mailer.beforeAddContent](/docs/api/mailer/beforeaddcontent)
event.
Parameters
- Illuminate\Mail\Message $message
- string $code
- array $data
- bool $plainOnly - Add only plain text content to the message
public bool addRawContentToMailer($message, $content, $data)
Same as addContentToMailer
except with raw content.
Parameters
- $message
- $content
- $data
public static void forgetInstance()
Forget this singleton's instance if it exists
public static void instance()
Create a new instance of this singleton.
public array listRegisteredLayouts()
Returns a list of the registered layouts.
public array listRegisteredPartials()
Returns a list of the registered partials.
public array listRegisteredTemplates()
Returns a list of the registered templates.
public void loadRegisteredTemplates()
Loads registered mail templates from modules and plugins
public void registerCallback(callable $callback)
Registers a callback function that defines mail templates. The callback function should register templates by calling the manager's registerMailTemplates() function. Thi instance is passed to the callback function as an argument. Usage:
MailManager::registerCallback(function ($manager) { $manager->registerMailTemplates([...]); });
Parameters
- callable $callback - A callable function.
public void registerMailLayouts($definitions)
Registers mail views and manageable layouts.
Parameters
- $definitions
public void registerMailPartials($definitions)
Registers mail views and manageable layouts.
Parameters
- $definitions
public void registerMailTemplates($definitions)
Registers mail views and manageable templates.
Parameters
- $definitions
public string render(string $content, array $data=array())
Render the Markdown template into HTML.
Parameters
- string $content
- array $data
public void renderPartial($code, $params=array())
Parameters
- $code
- $params
public void renderTemplate($template, $data=array())
Parameters
- $template
- $data
public string renderText($content $content, array $data=array())
Render the Markdown template into text.
Parameters
- $content $content
- array $data
public void renderTextTemplate($template, $data=array())
Parameters
- $template
- $data
Protected methods
protected void __construct()
Constructor.
protected void addContentToMailerInternal(Illuminate\Mail\Message $message, string $template, array $data, bool $plainOnly=false)
Internal method used to share logic between addRawContentToMailer
and addContentToMailer
Parameters
- Illuminate\Mail\Message $message
- string $template
- array $data
- bool $plainOnly - Add only plain text content to the message
protected void init()
Initialize the singleton free from constructor parameters.
protected void renderTwig($content, $data=array())
Internal helper for rendering Twig
Parameters
- $content
- $data
protected void startTwig()
Temporarily registers mail based token parsers with Twig.
protected void stopTwig()
Indicates that we are finished with Twig.