Plentymarkets interface documentation
Templates
Contracts
MailTemplateWidgetRepositoryContract
Register mail builder widgets.
Namespace
Plenty\Modules\Mail\Templates\Contracts
Methods
public registerWidget($widgetClass):void
Register a widget to be available in the mail builder.
Name |
Type |
Description |
|
public overrideWidget($widgetIdentifier, $overrideWidget):void
Override a widget class to extend data or settings of the widget.
Name |
Type |
Description |
|
The identifier of the original widget to override |
|
|
The class of the new class to get information of the widget from. |
Service
EmailService
EmailTemplatesSendServiceContract
The EmailTemplatesSendServiceContract is the interface for the email service. * This interface defines methods to list available accounts, get list of templates, get send email history, * render a template preview, send a template or send a custom email.
Namespace
Plenty\Modules\Mail\Templates\Contracts\Service\EmailService
Methods
public getAccounts($filters):array
List all email accounts that can be used to send emails (e.g. Webstore or Messenger inboxes)
Name |
Type |
Description |
|
List of filters, see REST API documentation for more information |
public getTemplatesTree($sortBy = "id", $sortOrder = "asc", $filters = []):Illuminate\Support\Collection
Return type: Collection
List all EmailBuilder templates and folders structured as a nested tree
Name |
Type |
Description |
|
Sort results by a specific field |
|
|
Sort results in ascending or descending order |
|
|
Filters to apply to the results |
public getEmailHistory($filters = []):array
List all sent email for a specific entity (e.g order, contact, etc.)
Name |
Type |
Description |
|
Filters to apply to the results, see REST API documentation for more information |
public getPreview($templateId, $data = []):array
Generates a render preview of a specific template
Name |
Type |
Description |
|
ID of the template to preview |
|
|
Array with additional parameters (e.g order ID, receiver email, etc.), see REST API documentation for more information |
public sendEmail($templateId, $data = []):array
Renders a template and sends an email to the specified recipients
Name |
Type |
Description |
|
ID of the template to be sent |
|
|
Array with additional parameters (e.g order ID, receiver email, etc.), see REST API documentation for more information |
public sendPreview($data = []):array
Sends a direct email to the specified recipients (a preview of a template or any other custom content email)
Name |
Type |
Description |
|
Array with email data (e.g Account ID, from, subject, body, receivers, cc, bcc, attachments, etc.), see REST API documentation for more information |
public getRecipient($data = []):array
Name |
Type |
Description |
|
Models
Templates
MailTemplateAttachments
The MailTemplateAttachments model. Stores the relation between * mail templates - static attachments
Namespace
Plenty\Modules\Mail\Templates\Models\Templates
Name | Type | Description |
---|---|---|
relationId |
plenty_mail_template_relation_id |
|
documentId |
plenty_documents.id // static attachment document id; optional FK plenty_documents |
|
createdAt |
The time the attachment was created as unix timestamp |
|
updatedAt |
The time the attachment was last updated as unix timestamp |
|
configId |
plenty_mail_template_base_config.id // mail template id; required |
|
isStaticDoc |
The reference type. The following reference types are available; required <ul> <li>0</li> // is dynamic <li>1</li> // is static </ul> |
|
dynamicAttachmentId |
Methods
public toArray()
Returns this model as an array.