Class EmailsController

Class EmailsController

PHP controller that handles the admin/emails page operations. You can also use it to perform email operations from JavaScript by providing encoded JSON arrays with email information from other pages.

HttpViewController implements HttpViewControllerInterface
AdminHttpViewController implements AdminStatusOnlyInterface
EmailsController

Methods summary

public proceed( HttpContextInterface $httpContext )

Initializes the controller.

public actionDefault( void ) : AdminPageHttpControllerResponse

Displays the administration emails page.

public actionDataTable( void ) : JsonHttpControllerResponse

[AJAX - GET] Server-side processing of the main emails table.

public actionSend( void ) : JsonHttpControllerResponse

[AJAX - POST] Sends and saves the provided email collection.

public actionQueue( void ) : JsonHttpControllerResponse

[AJAX - POST] Queue email records into the database.

public actionDelete( void ) : JsonHttpControllerResponse

[AJAX - POST] Remove email records from the database.

public actionGet( void ) : JsonHttpControllerResponse

[AJAX - POST] Get email record by ID.

public actionUploadAttachment( void ) : JsonHttpControllerResponse

[AJAX - POST] Upload new attachment file to server.

public actionUploadAttachmentWithFileManager( void ) : JsonHttpControllerResponse

The $_POST array contains information about the file that was uploaded. When an email file is uploaded it is stored in the "uploads/tmp" directory until the email is created and then is is moved to its own directory. The reason for this algorithm is that we do not want email attachments to be in one place altogether.

public actionDownloadAttachment( void ) : HttpControllerResponse|AdminPageHttpControllerResponse

Download email attachment file.

public actionDeleteAttachment( void ) : JsonHttpControllerResponse

[AJAX - POST] Remove existing "tmp" attachment from the server.

public actionDeleteOldAttachments( void ) : JsonHttpControllerResponse

[AJAX - POST] Delete old attachment files from emails.

public actionGetAttachmentsSize( void ) : JsonHttpControllerResponse

[AJAX] Get attachments size in MB

public actionGetEmailSettings( void ) : JsonHttpControllerResponse

[AJAX - GET] Get shops email settings and configure the client accordingly.

protected _getTableOrder( array $rule ) : string

Get the table order clause in string.

Methods inherited from AdminHttpViewController

validateCurrentAdminStatus()

Methods inherited from HttpViewController

__construct(), _callActionMethod(), _getPostData(), _getPostDataCollection(), _getQueryParameter(), _getQueryParametersCollection(), _getServerData(), _render(), _validatePageToken(), getTemplateFile()

Properties summary

protected $emailService : EmailServiceInterface

Used core emails operations.


		
protected $emailParser : EmailParser

Used for parsing and encoding operations.


		
protected $attachmentsHandler : AttachmentsHandler

Used for attachment files manipulation.


		

Properties inherited from HttpViewController

$assets, $contentView, $httpContextReader, $httpResponseProcessor, $postDataArray, $queryParametersArray, $serverDataArray