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.

Parameters

Name

Type

Description

$widgetClass

string

public overrideWidget($widgetIdentifier, $overrideWidget):void

Override a widget class to extend data or settings of the widget.

Parameters

Name

Type

Description

$widgetIdentifier

string

The identifier of the original widget to override

$overrideWidget

string

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)

Parameters

Name

Type

Description

$filters

array

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

Parameters

Name

Type

Description

$sortBy

string

Sort results by a specific field

$sortOrder

string

Sort results in ascending or descending order

$filters

array

Filters to apply to the results

public getEmailHistory($filters = []):array

List all sent email for a specific entity (e.g order, contact, etc.)

Parameters

Name

Type

Description

$filters

array

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

Parameters

Name

Type

Description

$templateId

int

ID of the template to preview

$data

array

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

Parameters

Name

Type

Description

$templateId

int

ID of the template to be sent

$data

array

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)

Parameters

Name

Type

Description

$data

array

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
Parameters

Name

Type

Description

$data

array

Models

Templates

MailTemplateAttachments

The MailTemplateAttachments model. Stores the relation between * mail templates - static attachments

Namespace

Plenty\Modules\Mail\Templates\Models\Templates

Properties
Name Type Description

relationId

int

plenty_mail_template_relation_id

documentId

int

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

int

plenty_mail_template_base_config.id // mail template id; required

isStaticDoc

bool

The reference type. The following reference types are available; required <ul> <li>0</li> // is dynamic <li>1</li> // is static </ul>

dynamicAttachmentId

string

Methods
public toArray()

Returns this model as an array.