Overview
  • Package
  • Class
  • Tree
  • Todo

Packages

  • AddonValue
    • Interfaces
  • AdminHttpViewControllers
  • ApiV2Controllers
  • Category
    • Collections
    • Entities
    • Factories
    • Interfaces
    • Providers
    • Repositories
    • Storages
  • Customer
    • Address
    • Country
    • CountryZone
    • Interfaces
    • Storages
    • Validation
    • ValueObjects
  • Email
    • Collections
    • Entities
    • Exceptions
    • Interfaces
    • Repository
    • ValueObjects
  • Extensions
    • Customers
    • Emails
    • Helpers
    • Orders
    • Serializers
  • Http
    • Collections
    • Exceptions
    • Factories
    • Interfaces
    • ValueObjects
  • HttpViewControllers
  • InfoBox
    • Interfaces
  • Invoice
    • Interfaces
    • ValueObjects
  • Loaders
    • CrossCuttingLoader
    • GXCoreLoader
    • Interfaces
  • Modules
    • Collections
    • Controllers
    • Interfaces
  • Order
    • Collections
    • Entities
    • Factories
    • Interfaces
    • Repositories
    • Storages
    • ValueObjects
  • Product
    • Collections
    • Entities
    • Factories
    • Interfaces
    • Providers
    • Repositories
    • Storages
  • ProductModule
    • Collections
    • Deleter
    • Entities
    • Factories
    • Interface
    • Interfaces
    • Reader
    • Repositories
    • Writer
  • Shared
    • ClassFinder
    • Exceptions
    • FileSystem
    • Interfaces
    • Storage
    • Types
  • SharedShoppingCart
    • Interfaces
  • Statistics
    • Interfaces
  • UserConfiguration
    • Interfaces
    • Repository

Classes

  • AdminFavoritesAjaxController
  • AdminInfoBoxAjaxController
  • AfterbuyAjaxController
  • DashboardController
  • DynamicShopMessagesController
  • EmailsController
  • EmbeddedModuleController
  • ImageProcessingController
  • InvoicesController
  • LawsController
  • MaxFileSizeController
  • ModuleCenterController
  • NewAttributesController
  • OrdersModalsAjaxController
  • OrdersOverviewAjaxController
  • OrdersOverviewController
  • OrderTooltipController
  • PackedDownloadController
  • ShopKeyController
  • TemplateConfigurationController
  • UserConfigurationController

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
Extended by AdminHttpViewController implements AdminStatusOnlyInterface
Extended by EmailsController
Package: AdminHttpViewControllers
Category: System
Located at Controllers/HttpView/Admin/EmailsController.inc.php

Methods summary

public
# proceed( HttpContextInterface $httpContext )

Initializes the controller.

Initializes the controller.

Perform the common operations before the parent class proceeds with the controller method execution. In this case every method needs the EmailService so it is loaded once before every method.

Parameters

$httpContext

Throws

LogicException
When no action method is found by the http context reader.

Overrides

HttpViewController::proceed
public AdminPageHttpControllerResponse
# actionDefault( )

Displays the administration emails page.

Displays the administration emails page.

The administration page contains various JavaScript controllers which will make AJAX requests to this class in order to get/store email information. Check the JavaScript code of the page in the "admin/javascript/engine/controllers/emails" directory.

Returns

AdminPageHttpControllerResponse

Overrides

HttpViewController::actionDefault
public JsonHttpControllerResponse
# actionDataTable( )

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

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

The data returned by this method will be used by the main table of the page which will display the emails records. DataTables will automatically make an AJAX request and display the returned data.

Returns

JsonHttpControllerResponse
Array that contains the table data.

Link

https://datatables.net/examples/ajax/objects.html
http://www.datatables.net/examples/server_side/simple.html
public JsonHttpControllerResponse
# actionSend( )

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

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

This method expects the $_POST['collection'] array to be present, containing email records to be send. Check the "EmailParser" class to see the expected JSON format.

Returns

JsonHttpControllerResponse
Returns a success response or exception information.
public JsonHttpControllerResponse
# actionQueue( )

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

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

The queue operation will save the email with a pending status. Queue operation will be executed for all the email records inside the $_POST['collection'] variable.

Returns

JsonHttpControllerResponse
Returns a success response or exception information.
public JsonHttpControllerResponse
# actionDelete( )

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

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

Will remove all the email records inside the $_POST['collection'] variable.

Returns

JsonHttpControllerResponse
Returns a success response or exception information.
public JsonHttpControllerResponse
# actionGet( )

[AJAX - POST] Get email record by ID.

[AJAX - POST] Get email record by ID.

This method uses the provided $_POST['email_id'] value to fetch the data of the email and return it to the client. It is not used by the admin/emails page but might be useful in other pages.

Returns

JsonHttpControllerResponse
Returns a success response or exception information.
public JsonHttpControllerResponse
# actionUploadAttachment( )

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

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

The $_FILES 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.

Returns

JsonHttpControllerResponse
Returns a success response or exception information.
public HttpControllerResponse|AdminPageHttpControllerResponse
# actionDownloadAttachment( )

Download email attachment file.

Download email attachment file.

This method will provide the required headers for downloading the requested attachment file.

If the requested file is was not found then an error message will be displayed.

Returns

HttpControllerResponse|AdminPageHttpControllerResponse
public JsonHttpControllerResponse
# actionDeleteAttachment( )

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

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

This method requires an array present in the $postDataArray that contain the paths to the server "tmp" attachments to be removed. It will not remove attachments that reside in other directories because they might be used by other email records (e.g. forward existing email with attachments -> user might remove attachment that is used by the original email record causing problems to the system).

Returns

JsonHttpControllerResponse
Returns a success response or exception information.
public JsonHttpControllerResponse
# actionDeleteOldAttachments( )

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

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

This method will filter the emails and remove their attachments on the provided date and before. This is necessary because the admin user needs a way to clean the old unnecessary files from the server and free some extra space. As an extra action this method will empty the "uploads/tmp" directory.

Returns

JsonHttpControllerResponse
Returns a success response or exception information.
public JsonHttpControllerResponse
# actionGetAttachmentsSize( )

[AJAX] Get attachments size in MB

[AJAX] Get attachments size in MB

Returns

JsonHttpControllerResponse
public JsonHttpControllerResponse
# actionGetEmailSettings( )

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

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

Returns

JsonHttpControllerResponse
protected string
# _getTableOrder( array $rule )

Get the table order clause in string.

Get the table order clause in string.

Since the EmailsController handles the page main table it needs to take care of many operations such as filtering, limiting and ordering. This method will return the correct order string for each table, but needs to be updated if there is a change in the column order.

Parameters

$rule
Contains the DataTables order data.

Returns

string
Returns the order by value to be used by the CI query builder.

Link

http://www.datatables.net/manual/server-side

Methods inherited from AdminHttpViewController

validateCurrentAdminStatus()

Methods inherited from HttpViewController

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

Properties summary

protected EmailServiceInterface $emailService

Used core emails operations.

Used core emails operations.

#
protected EmailParser $emailParser

Used for parsing and encoding operations.

Used for parsing and encoding operations.

#
protected AttachmentsHandler $attachmentsHandler

Used for attachment files manipulation.

Used for attachment files manipulation.

#

Properties inherited from HttpViewController

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

API documentation generated by ApiGen