\Notifications

This library handles all the notification email deliveries on the system.

Custom system settings for the notification section are loaded during the execution of each class methods.

Summary

Methods
Properties
Constants
__construct()
send_appointment_details()
send_delete_appointment()
send_password()
send_new_installation()
No public properties found
No constants found
No protected methods found
No protected properties found
N/A
replace_template_variables()
$ci
N/A

Properties

$ci

$ci : 

Type

Methods

__construct()

__construct() 

Class Constructor

send_appointment_details()

send_appointment_details(array  $appointment_data, array  $provider_data, array  $service_data,   $customer_data, array  $company_settings, string  $title, string  $message, string  $appointment_link, string  $receiver_address) : boolean

Send an email with the appointment details.

This email template also needs an email title and an email text in order to complete the appointment details.

Parameters

array $appointment_data

Contains the appointment data.

array $provider_data

Contains the provider data.

array $service_data

Contains the service data.

$customer_data
array $company_settings

Contains settings of the company. By the time the "company_name", "company_link" and "company_email" values are required in the array.

string $title

The email title may vary depending the receiver.

string $message

The email message may vary depending the receiver.

string $appointment_link

This link is going to enable the receiver to make changes to the appointment record.

string $receiver_address

The receiver email address.

Returns

boolean —

Returns the operation result.

send_delete_appointment()

send_delete_appointment(array  $appointment_data, array  $provider_data, array  $service_data, array  $customer_data, array  $company_settings, string  $to_address, string  $reason) 

Send an email notification to both provider and customer on appointment removal.

Whenever an appointment is cancelled or removed, both the provider and customer need to be informed. This method sends the same email twice.

IMPORTANT! This method's arguments should be taken from database before the appointment record is deleted.

Parameters

array $appointment_data

The record data of the removed appointment.

array $provider_data

The record data of the appointment provider.

array $service_data

The record data of the appointment service.

array $customer_data

The record data of the appointment customer.

array $company_settings

Some settings that are required for this function. By now this array must contain the following values: "company_link", "company_name", "company_email".

string $to_address

The email address of the email receiver.

string $reason

The reason why the appointment is deleted.

send_password()

send_password(string  $password, string  $email,   $company_settings) 

This method sends an email with the new password of a user.

Parameters

string $password

Contains the new password.

string $email

The receiver's email address.

$company_settings

send_new_installation()

send_new_installation(  $company_name,   $company_email,   $company_link) 

Sends a simple email to notify for a new installation.

This method will be only used for tracking the number of installations. No personal data will be retrieved for any other cause.

Parameters

$company_name
$company_email
$company_link

replace_template_variables()

replace_template_variables(array  $replace_array, string  $email_html) : string

Replace the email template variables.

This method finds and replaces the html variables of an email template. It is used to generate dynamic HTML emails that are send as notifications to the system users.

Parameters

array $replace_array

Array that contains the variables to be replaced.

string $email_html

The email template hmtl.

Returns

string —

Returns the new email html that contain the variables of the $replace_array.