CalendarMailManager
extends CalendarLibrary
in package
CalendarMailManager
Tags
Table of Contents
Constants
- ATTACHMENT_FIELD_KEY = 'attachment_id'
- Attachment field key
- MAIL_ALERT_REG = 3
- Mail Action Alert registration
- MAIL_CONFIRM_REG = 2
- Mail Action Confirm registration
- MAIL_INVITATION = 1
- Mail action Invitation
- MAIL_INVITATION_TO_ALL = 'all'
- Send the invitation mail to all contacts This is the default option
- MAIL_INVITATION_TO_INACTIVE = 'inactive'
- Send the invitation mail only to inactive contacts
- MAIL_INVITATION_TO_NEW = 'new'
- Send the invitation mail only to new contacts that have not yet received an invitation
- MAIL_INVITATION_TO_REGISTERED = 'registered'
- Send the invitation mail only to registered in contacts
- MAIL_INVITATION_TO_SIGNEDIN_FILTERED = 'signedIn'
- Send the invitation mail only to signed in contacts
- MAIL_NOTFY_NEW_APP = 4
- mail action notify new appoinment
- MAP_FIELD_KEY = 'map_id'
- map field key
- PICTURE_FIELD_KEY = 'picture_id'
- Picture field key
- SHOW_EVENTS_OF_TODAY = 0
- Setting value for option frontendPastEvents defining that all events having their start date as of today shall be listed in frontend till the end of today.
- SHOW_EVENTS_UNTIL_END = 1
- Setting value for option frontendPastEvents defining that only those events shall be listed in frontend that have not yet ended (end date lies in the past)
- SHOW_EVENTS_UNTIL_START = 2
- Setting value for option frontendPastEvents defining that only those events shall be listed in frontend that have not yet started (start date lies in the future)
Properties
- $_objTpl : object
- Template object
- $arrCommunityGroups : array<string|int, mixed>
- Community group array
- $arrFrontendLanguages : array<string|int, mixed>
- active frontend languages
- $arrSettings : array<string|int, mixed>
- Settings array
- $csvSeparator : string
- CSV separator
- $errMessage : string
- Error message
- $mailList : array<string|int, mixed>
- Mail list array
- $moduleLangVar : string
- module language variable prefix
- $moduleName : string
- module name
- $moduleTablePrefix : string
- module table prefix
- $okMessage : type
- Success message
- $pageContent : string
- template content
- $settings : array<string|int, mixed>
- Static settings array to cache the fetched data from the database
- $cx : Cx
- $em : EntityManager
- $mailActions : array<string|int, mixed>
- Notification mail types
Methods
- __construct() : mixed
- Constructor
- checkAccess() : null
- Checks the access level for the given action
- detachEntity() : null
- Detach the entity
- detachJoinedEntity() : null
- Detach the jointed entity
- format2userDate() : string
- Returns the date string (according to the calendar's configuration) from a \DateTime object.
- format2userDateTime() : string
- Returns the date/time string (according to the calendar's configuration) from a \DateTime object.
- format2userTime() : string
- Returns the time string 'H:i' from a \DateTime object
- formatDateTime2user() : string
- Returns a date/time string from a \DateTime object.
- generateKey() : string
- generates the random key
- getCommunityGroups() : null
- Initilize the available group
- getComponent() : SystemComponentController
- Get component controller object
- getDateFormat() : string
- Return's the dataformat based on the type
- getDateTime() : DateTime
- Returns a \DateTime object from a calendar date/time string.
- getDbDateTimeFromIntern() : DateTime
- Returns a \DateTime object in db timezone
- getExeceptionDates() : array<string|int, mixed>
- Returns all series dates based on the given post data
- getFrontendLanguages() : null
- Initialize the active frontend languages array
- getHeadlinePlaceholders() : array<string|int, mixed>
- Get the list of calendar headline placeholders
- getInternDateTimeFromDb() : DateTime
- Returns a \DateTime object from a date/time string.
- getInternDateTimeFromUser() : DateTime
- Returns a \DateTime object from a date/time string.
- getJavascript() : string
- Return's the billing address javascript
- getMailActions() : array<string|int, mixed>
- Get list (as array) of available notification mail types
- getMailList() : array<string|int, mixed>
- Return's the mailing list
- getSendMailRecipientsCount() : int
- Returns the array recipients count
- getSettings() : null
- Prepares the settings from database to array format
- getUserDateTimeFromIntern() : DateTime
- Returns a \DateTime object in user timezone
- init() : mixed
- Initialize $cx and $em
- sendMail() : mixed
- Initialize the mail functionality to the recipient
- showMail() : mixed
- Sets the mail placeholders to the template
- showMailList() : mixed
- Set the mailing list placeholders to the template
- triggerEvent() : null
- Trigger the event
- getMatchingMailListLocaleIdByBackendId() : int
- parseDateTimeString() : array<string|int, mixed>
- Split a datetime string (i.E.: '08.06.2015 13:37') into an array containing the date, hour and minutes information as separate elements.
- getRegistrationData() : array<string|int, mixed>
- Loads the RegistrationData text and Html mail content
- getSendMailLangId() : mixed
- getSendMailRecipients() : array<string|int, mixed>
- Returns the array recipients
- loadMailList() : mixed
- Loads the mail template for the give action
Constants
ATTACHMENT_FIELD_KEY
Attachment field key
public
string
ATTACHMENT_FIELD_KEY
= 'attachment_id'
MAIL_ALERT_REG
Mail Action Alert registration
public
mixed
MAIL_ALERT_REG
= 3
Default recipient: none
MAIL_CONFIRM_REG
Mail Action Confirm registration
public
mixed
MAIL_CONFIRM_REG
= 2
Default recipient: author
MAIL_INVITATION
Mail action Invitation
public
mixed
MAIL_INVITATION
= 1
Default recipient: none
MAIL_INVITATION_TO_ALL
Send the invitation mail to all contacts This is the default option
public
mixed
MAIL_INVITATION_TO_ALL
= 'all'
MAIL_INVITATION_TO_INACTIVE
Send the invitation mail only to inactive contacts
public
mixed
MAIL_INVITATION_TO_INACTIVE
= 'inactive'
Default: all
MAIL_INVITATION_TO_NEW
Send the invitation mail only to new contacts that have not yet received an invitation
public
mixed
MAIL_INVITATION_TO_NEW
= 'new'
MAIL_INVITATION_TO_REGISTERED
Send the invitation mail only to registered in contacts
public
mixed
MAIL_INVITATION_TO_REGISTERED
= 'registered'
MAIL_INVITATION_TO_SIGNEDIN_FILTERED
Send the invitation mail only to signed in contacts
public
mixed
MAIL_INVITATION_TO_SIGNEDIN_FILTERED
= 'signedIn'
MAIL_NOTFY_NEW_APP
mail action notify new appoinment
public
mixed
MAIL_NOTFY_NEW_APP
= 4
Default recipient: admin
MAP_FIELD_KEY
map field key
public
string
MAP_FIELD_KEY
= 'map_id'
PICTURE_FIELD_KEY
Picture field key
public
string
PICTURE_FIELD_KEY
= 'picture_id'
SHOW_EVENTS_OF_TODAY
Setting value for option frontendPastEvents defining that all events having their start date as of today shall be listed in frontend till the end of today.
public
int
SHOW_EVENTS_OF_TODAY
= 0
SHOW_EVENTS_UNTIL_END
Setting value for option frontendPastEvents defining that only those events shall be listed in frontend that have not yet ended (end date lies in the past)
public
int
SHOW_EVENTS_UNTIL_END
= 1
SHOW_EVENTS_UNTIL_START
Setting value for option frontendPastEvents defining that only those events shall be listed in frontend that have not yet started (start date lies in the future)
public
int
SHOW_EVENTS_UNTIL_START
= 2
Tags
Properties
$_objTpl
Template object
public
object
$_objTpl
Tags
$arrCommunityGroups
Community group array
public
array<string|int, mixed>
$arrCommunityGroups
= array()
Tags
$arrFrontendLanguages
active frontend languages
public
array<string|int, mixed>
$arrFrontendLanguages
= array()
Tags
$arrSettings
Settings array
public
array<string|int, mixed>
$arrSettings
= array()
Tags
$csvSeparator
CSV separator
public
string
$csvSeparator
= ';'
Tags
$errMessage
Error message
public
string
$errMessage
= ''
Tags
$mailList
Mail list array
public
array<string|int, mixed>
$mailList
= array()
Tags
$moduleLangVar
module language variable prefix
public
string
$moduleLangVar
= "CALENDAR"
Tags
$moduleName
module name
public
string
$moduleName
= "Calendar"
Tags
$moduleTablePrefix
module table prefix
public
string
$moduleTablePrefix
= "calendar"
Tags
$okMessage
Success message
public
type
$okMessage
= ''
Tags
$pageContent
template content
public
string
$pageContent
Tags
$settings
Static settings array to cache the fetched data from the database
public
static array<string|int, mixed>
$settings
= array()
$cx
protected
Cx
$cx
$em
protected
EntityManager
$em
$mailActions
Notification mail types
protected
array<string|int, mixed>
$mailActions
= array()
Methods
__construct()
Constructor
public
__construct() : mixed
checkAccess()
Checks the access level for the given action
public
checkAccess(string $strAction) : null
It checks the access level for the given action and return's null if access is granted otherwise it redirect the action to the respective fallback pages.
Parameters
- $strAction : string
-
possible values are add_event, edit_event, my_events
Return values
nulldetachEntity()
Detach the entity
public
detachEntity(object $entity, string $methodName, array<string|int, mixed> $relation, array<string|int, mixed> $joinEntityRelation) : null
Parameters
- $entity : object
-
entity object
- $methodName : string
-
method name
- $relation : array<string|int, mixed>
-
relationship array
- $joinEntityRelation : array<string|int, mixed>
-
joined entity's relationship array
Return values
nulldetachJoinedEntity()
Detach the jointed entity
public
detachJoinedEntity(object $entity, array<string|int, mixed> $relations, array<string|int, mixed> $joinEntityRelation) : null
Parameters
- $entity : object
-
entity object
- $relations : array<string|int, mixed>
-
relationship array
- $joinEntityRelation : array<string|int, mixed>
-
joined entity's relationship array
Return values
nullformat2userDate()
Returns the date string (according to the calendar's configuration) from a \DateTime object.
public
format2userDate(DateTime $dateTime) : string
The SUPPLIED \DateTime object must be in INTERNAL timezone. The RETURNED date string will be in USER timezone.
Parameters
- $dateTime : DateTime
-
DateTime object in internal timezone
Return values
string —A date string
format2userDateTime()
Returns the date/time string (according to the calendar's configuration) from a \DateTime object.
public
format2userDateTime(DateTime $dateTime) : string
The SUPPLIED \DateTime object must be in INTERNAL timezone. The RETURNED date/time string will be in USER timezone.
Parameters
- $dateTime : DateTime
-
DateTime object in internal timezone
Return values
string —A date/time string
format2userTime()
Returns the time string 'H:i' from a \DateTime object
public
format2userTime(DateTime $dateTime) : string
The SUPPLIED \DateTime object must be in INTERNAL timezone. The RETURNED time string will be in USER timezone.
Parameters
- $dateTime : DateTime
-
DateTime object in internal timezone
Return values
string —A time string
formatDateTime2user()
Returns a date/time string from a \DateTime object.
public
formatDateTime2user(DateTime $dateTime, string $format) : string
The SUPPLIED \DateTime object must be in INTERNAL timezone. The RETURNED date/time string will be in USER timezone.
Parameters
- $dateTime : DateTime
-
DateTime object in internal timezone
- $format : string
-
Format string
Return values
string —A date/time string formatted according to $format
generateKey()
generates the random key
public
generateKey() : string
Return values
string —combination of alphabet and number in random order
getCommunityGroups()
Initilize the available group
public
getCommunityGroups() : null
Fetch the available group from the database and assign those values into $this->arrCommunityGroups
Return values
nullgetComponent()
Get component controller object
public
getComponent(string $name) : SystemComponentController
Parameters
- $name : string
-
component name
Return values
SystemComponentController —The requested component controller or null if no such component exists
getDateFormat()
Return's the dataformat based on the type
public
getDateFormat([int $type = null ]) : string
Return's the dateformat by the given type 1 => frontend (javascript format alone) else backend
Parameters
- $type : int = null
-
type 1 => frontend (javascript format alone) else backend
Return values
string —Date format
getDateTime()
Returns a \DateTime object from a calendar date/time string.
public
getDateTime(string $date[, int $hour = 0 ][, int $minute = 0 ]) : DateTime
The format of a calendar date/time string can be configured in the settings section of the calendar component.
Note: In constrast to this method, the method getUserDateTimeFromUser() expects a PHP date/time string.
The SUPPLIED calendar date/time string must be in USER timezone. The RETURNED \DateTime object will be in INTERNAL timezone.
Parameters
- $date : string
-
A calendar date/time string in user timezone
- $hour : int = 0
-
Hour value
- $minute : int = 0
-
Minute value
Return values
DateTime —\DateTime object in internal timezone
getDbDateTimeFromIntern()
Returns a \DateTime object in db timezone
public
getDbDateTimeFromIntern(DateTime $dateTime) : DateTime
The SUPPLIED \DateTime object must be in INTERNAL timezone. The RETURNED \DateTime object will be in DB timezone.
Parameters
- $dateTime : DateTime
-
\DateTime object in internal timezone
Return values
DateTime —\DateTime in db timezone
getExeceptionDates()
Returns all series dates based on the given post data
public
getExeceptionDates() : array<string|int, mixed>
Return values
array<string|int, mixed> —Array of dates
getFrontendLanguages()
Initialize the active frontend languages array
public
getFrontendLanguages() : null
Fetch the active frontend languages from the database and assign those values into $this->arrFrontendLanguages
Return values
nullgetHeadlinePlaceholders()
Get the list of calendar headline placeholders
public
static getHeadlinePlaceholders() : array<string|int, mixed>
Return values
array<string|int, mixed>getInternDateTimeFromDb()
Returns a \DateTime object from a date/time string.
public
getInternDateTimeFromDb([string $time = 'now' ]) : DateTime
The SUPPLIED date/time string must be in DB timezone. The RETURNED \DateTime object will be in INTERNAL timezone.
Parameters
- $time : string = 'now'
-
A date/time string in db timezone
Return values
DateTime —\DateTime object in internal timezone
getInternDateTimeFromUser()
Returns a \DateTime object from a date/time string.
public
getInternDateTimeFromUser([string $time = 'now' ]) : DateTime
The SUPPLIED date/time string must be in USER timezone. The RETURNED \DateTime object will be in INTERNAL timezone.
Parameters
- $time : string = 'now'
-
A date/time string in user timezone
Return values
DateTime —\DateTime object in internal timezone
getJavascript()
Return's the billing address javascript
public
getJavascript() : string
Return values
string —Billing HereDoc phpscript
getMailActions()
Get list (as array) of available notification mail types
public
getMailActions() : array<string|int, mixed>
Return values
array<string|int, mixed> —Returns the list ($this->mailActions) of available notification mail types
getMailList()
Return's the mailing list
public
getMailList() : array<string|int, mixed>
Tags
Return values
array<string|int, mixed> —Return's the mailing list
getSendMailRecipientsCount()
Returns the array recipients count
public
getSendMailRecipientsCount(int $actionId, object $objEvent[, int $regId = 0 ][, object $objRegistration = null ][, string $sendInvitationTo = self::MAIL_INVITATION_TO_ALL ]) : int
Parameters
- $actionId : int
-
Mail Action
- $objEvent : object
-
Event object
- $regId : int = 0
-
registration id
- $objRegistration : object = null
-
Registration object
- $sendInvitationTo : string = self::MAIL_INVITATION_TO_ALL
-
The filter to which contacts the mail should be sent
Return values
int —returns the array recipients count
getSettings()
Prepares the settings from database to array format
public
getSettings() : null
Loads the settings values from the database and assign those values into $this->arrSettings
Return values
nullgetUserDateTimeFromIntern()
Returns a \DateTime object in user timezone
public
getUserDateTimeFromIntern(DateTime $dateTime) : DateTime
The SUPPLIED \DateTime object must be in INTERNAL timezone. The RETURNED \DateTime object will be in USER timezone.
Parameters
- $dateTime : DateTime
-
\DateTime object in internal timezone
Return values
DateTime —\DateTime in user timezone
init()
Initialize $cx and $em
public
init() : mixed
sendMail()
Initialize the mail functionality to the recipient
public
sendMail(CalendarEvent $event, int $actionId[, int $regId = null ][, array<string|int, mixed> $arrMailTemplateIds = array() ][, array<string|int, mixed> $sendInvitationTo = CalendarMailManager::MAIL_INVITATION_TO_ALL ]) : mixed
Parameters
- $event : CalendarEvent
-
Event instance
- $actionId : int
-
Mail action id
- $regId : int = null
-
Registration id
- $arrMailTemplateIds : array<string|int, mixed> = array()
-
Prefered templates of the specified action to be sent
- $sendInvitationTo : array<string|int, mixed> = CalendarMailManager::MAIL_INVITATION_TO_ALL
-
Which group of contacts should get the mail
showMail()
Sets the mail placeholders to the template
public
showMail(object $objTpl, int $mailId) : mixed
Parameters
- $objTpl : object
- $mailId : int
Tags
showMailList()
Set the mailing list placeholders to the template
public
showMailList(object $objTpl) : mixed
Parameters
- $objTpl : object
Tags
triggerEvent()
Trigger the event
public
triggerEvent(string $eventName[, object $entity = null ][, array<string|int, mixed> $relations = array() ][, bool $isDetach = false ]) : null
Parameters
- $eventName : string
-
trigger event name
- $entity : object = null
-
entity object
- $relations : array<string|int, mixed> = array()
-
entity relations
- $isDetach : bool = false
-
is detachable entity
Return values
nullgetMatchingMailListLocaleIdByBackendId()
protected
getMatchingMailListLocaleIdByBackendId(int $backendId) : int
Parameters
- $backendId : int
-
ID of backend language
Tags
Return values
int —Return the locale ID that uses the same language as
$backendId and is used by one of the loaded static::$mailList.
If no entry in static::$mailList matches, then 0
is
returned.
parseDateTimeString()
Split a datetime string (i.E.: '08.06.2015 13:37') into an array containing the date, hour and minutes information as separate elements.
protected
parseDateTimeString(string $datetime[, bool $allDay = false ][, bool $end = false ]) : array<string|int, mixed>
Parameters
- $datetime : string
-
The datetime string to parse.
- $allDay : bool = false
-
If set to TRUE, then the returned hour and minutes value are set to 0, unless $end is also set to TRUE.
- $end : bool = false
-
If set to TRUE and $allDay is also set to TRUE, then the returned hour is set to 23 and the minutes to 59. If $allDay is not set to TRUE, then this argument has no effect.
Return values
array<string|int, mixed> —Return parsed datetime as array having the following format:
array( d.m.Y, G, m )
getRegistrationData()
Loads the RegistrationData text and Html mail content
private
getRegistrationData(object $objRegistration) : array<string|int, mixed>
Parameters
- $objRegistration : object
-
Registration object
Return values
array<string|int, mixed> —RegistrationData text and Html mail
getSendMailLangId()
private
getSendMailLangId(mixed $actionId, mixed $recipient) : mixed
Parameters
- $actionId : mixed
- $recipient : mixed
getSendMailRecipients()
Returns the array recipients
private
getSendMailRecipients(int $actionId, object $objEvent[, int $regId = 0 ][, object $objRegistration = null ][, string $sendInvitationTo = self::MAIL_INVITATION_TO_ALL ]) : array<string|int, mixed>
Parameters
- $actionId : int
-
Mail Action
- $objEvent : object
-
Event object
- $regId : int = 0
-
registration id
- $objRegistration : object = null
-
Registration object
- $sendInvitationTo : string = self::MAIL_INVITATION_TO_ALL
-
The filter to which contacts the
Tags
Return values
array<string|int, mixed> —returns the array recipients
loadMailList()
Loads the mail template for the give action
private
loadMailList(int $actionId, array<string|int, mixed> $arrMailTemplateIds) : mixed
Parameters
- $actionId : int
-
Mail action see CalendarMailManager:: const vars
- $arrMailTemplateIds : array<string|int, mixed>
-
Specific Mail template ids to load