Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Documented the new registerMailLayouts method #326

Merged
merged 2 commits into from
Oct 8, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 2 additions & 0 deletions plugin-registration.md
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,9 @@ Method | Description
**registerFormWidgets()** | registers any [back-end form widgets](../backend/widgets#form-widget-registration) supplied by this plugin.
**registerReportWidgets()** | registers any [back-end report widgets](../backend/widgets#report-widget-registration), including the dashboard widgets.
**registerListColumnTypes()** | registers any [custom list column types](../backend/lists#custom-column-types) supplied by this plugin.
**registerMailLayouts()** | registers any [mail view layouts](mail#mail-template-registration) supplied by this plugin.
**registerMailTemplates()** | registers any [mail view templates](mail#mail-template-registration) supplied by this plugin.
**registerMailPartials()** | registers any [mail view partials](mail#mail-template-registration) supplied by this plugin.
**registerSchedule()** | registers [scheduled tasks](../plugin/scheduling#defining-schedules) that are executed on a regular basis.

<a name="basic-plugin-information"></a>
Expand Down
16 changes: 12 additions & 4 deletions services-mail.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
- [Mail views](#mail-views)
- [Mail templates](#mail-templates)
- [Mail layouts](#mail-layouts)
- [Registering mail templates & partials](#mail-template-registration)
- [Registering mail layouts, templates & partials](#mail-template-registration)
- [Global variables](#mail-global-variables)
- [Mail & local development](#mail-and-local-development)

Expand Down Expand Up @@ -347,7 +347,7 @@ Default | default | Used for public facing, front-end mail
System | system | Used for internal, back-end mail

<a name="mail-template-registration"></a>
### Registering mail templates & partials
### Registering mail layouts, templates & partials

Mail views can be registered as templates that are automatically generated in the back-end ready for customization. Mail templates can be customized via the *Settings > Mail templates* menu. The templates can be registered by overriding the `registerMailTemplates` method of the [Plugin registration class](../plugin/registration#registration-file).

Expand All @@ -361,7 +361,7 @@ Mail views can be registered as templates that are automatically generated in th

The method should return an array of [mail view names](#mail-views).

Like templates, mail partials can be registered by overriding the `registerMailPartials` method of the [Plugin registration class](../plugin/registration#registration-file). Mail partials can be customized via the *Settings > Mail partials* menu.
Like templates, mail partials and layouts can be registered by overriding the `registerMailPartials` and `registerMailLayouts` methods of the [Plugin registration class](../plugin/registration#registration-file).


public function registerMailPartials()
Expand All @@ -372,8 +372,16 @@ Like templates, mail partials can be registered by overriding the `registerMailP
];
}

public function registerMailLayouts()
{
return [
'marketing' => 'acme.blog::layouts.marketing',
'notification' => 'acme.blog::layouts.notification',
];
}


The method should return an array of [mail view names](#mail-views). The array key will be used as `code` property for the partial.
The methods should return an array of [mail view names](#mail-views). The array key will be used as `code` property for the partial or layout.

<a name="mail-global-variables"></a>
### Global variables
Expand Down