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
Throws
LogicException When no action method is found by the http context reader.
Overrides
|
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
Throws
RuntimeException If page token generator was not found.
InvalidArgumentException
Overrides
|
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
Link
|
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
|
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
|
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
|
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
|
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
|
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
|
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
|
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
|
public
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
|
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
|