Documentation

NewsletterManager extends NewsletterLib

Class newsletter

Newsletter module class

Tags
copyright

CLOUDREXX CMS - CLOUDREXX AG

author

Cloudrexx Development Team info@cloudrexx.com

access

public

version
1.0.0
subpackage

module_newsletter

Table of Contents

Constants

UNSUBSCRIBE_BEHAVIOR_AUTOMATIC  = 'automatic'
UNSUBSCRIBE_BEHAVIOR_MANUAL  = 'manual'
USER_TYPE_ACCESS  = 'access'
USER_TYPE_CORE  = 'core'
USER_TYPE_CRM  = 'crm'
USER_TYPE_NEWSLETTER  = 'newsletter'

Properties

$_arrMailPriority  : mixed
$_arrRecipientTitles  : mixed
$_attachmentPath  : mixed
$_objTpl  : mixed
$_pageTitle  : mixed
$_stdMailPriority  : mixed
$months  : mixed
$strErrMessage  : mixed
$strOkMessage  : mixed
$act  : mixed
$arrLists  : array<string|int, mixed>
List of present Lists

Methods

__construct()  : mixed
PHP5 constructor
_addList()  : bool
Add a list with the given name and status
_addMail()  : mixed
_addMailAttachment()  : mixed
_addRecipient()  : bool
Add a recipient with the given parameter values and subscribe to the lists with their ID present in $arrLists
_addRecipientTitle()  : mixed
_addTemplate()  : mixed
_changeListStatus()  : mixed
_checkUniqueListName()  : mixed
_copyMail()  : mixed
_createDatesDropdown()  : mixed
Create and select the date dropdowns for choosing the birthday
_deleteInactiveRecipients()  : void
delete all inactice recipients
_deleteList()  : mixed
_deleteMail()  : mixed
_deleteRecipient()  : mixed
_editList()  : mixed
_editMail()  : null
Add/Edit the mail template
_editTemplate()  : mixed
_editUser()  : mixed
_emailCode()  : mixed
_flushList()  : mixed
_getAssociatedListSelection()  : mixed
_getAssociatedListsOfRecipient()  : array<string|int, mixed>
Returns an array of List IDs to which the recipient with the given ID is subscribed
_getBodyContent()  : mixed
_getEmailsDropDown()  : mixed
_getHTML()  : mixed
_getList()  : mixed
_getListHTML()  : mixed
_getMailPriorityMenu()  : mixed
_getNewsPage()  : null
Parse the news section
_getNewsPreviewPage()  : null
Display the preview of the news in email template
_getRecipientTitleMenu()  : mixed
_getRecipientTitles()  : mixed
_getSettings()  : mixed
This is a workaround for PHP 7 compatability.
_getTemplateMenu()  : mixed
_getTemplates()  : mixed
_initRecipientTitles()  : mixed
_isUniqueRecipientEmail()  : mixed
_lists()  : mixed
Display the list administration page
_mails()  : mixed
_prepareNewsletterLinksForCopy()  : mixed
_prepareNewsletterLinksForStore()  : mixed
_prepareNewsPreview()  : string
Replace the placeholders formats
_removeMailAttachment()  : mixed
_sendMail()  : mixed
Send the mails
_sendMailPage()  : mixed
Show the mail send page
_sendTestMail()  : mixed
_setMailLists()  : mixed
_setRecipientLists()  : bool
Add the recipient with the given ID to all the lists with their IDs present in the array
_setTmpSending()  : mixed
Add the email address to the temp
_showEmailFeedbackAnalysis()  : mixed
_showLinkFeedbackAnalysis()  : mixed
_showRecipientEmailFeedbackAnalysis()  : mixed
_showRecipientFeedbackAnalysis()  : mixed
_templates()  : mixed
_update()  : mixed
_updateList()  : mixed
_updateMail()  : mixed
_updateRecipient()  : mixed
_updateTemplate()  : mixed
_userList()  : mixed
_users()  : mixed
_validateRecipientAttributes()  : mixed
autoCleanRegisters()  : mixed
Auto clean a registers
CategoryDropDown()  : mixed
ConfigDispatch()  : mixed
ConfigHTML()  : mixed
DateForDB()  : mixed
dateFromInput()  : long
Takes a date in the format dd.mm.yyyy hh:mm and returns it's representation as mktime()-timestamp.
dbFromDate()  : string
Takes a mktime()-timestamp and formats it as yyyy-mm-dd hh:mm:00 for insertion in db.
delTemplate()  : mixed
edituserSort()  : mixed
emailEditParseLists()  : mixed
Parse the lists to be selected as email recipients
emailTemplates()  : mixed
Parse Settings E-mail templates section
exportuser()  : mixed
feedback()  : mixed
getListIdByName()  : int
Returns the ID of the list specified by its name
getListNameById()  : mixed
Get newsletter list name by given id
getLists()  : array<string|int, mixed>
Returns an array of all Newsletter lists
getNewsletterPlaceHoldersList()  : string
Get available placeholders in newsletter notification mails
getNewsMailContent()  : string
Get News content to send email
getPage()  : mixed
Set the backend page
GetProfileURL()  : mixed
Return link to the profile of a user
getRecipientLocaleIdByRecipientId()  : int
Returns the Language ID for a newsletter recipient
getSettings()  : mixed
This is a workaround for PHP 7 compatability.
GetTemplateSource()  : mixed
GetUnsubscribeURL()  : mixed
Get the URL to the page to unsubscribe
getUsersPreferredLanguageId()  : int
Returns the Language ID for a newsletter user
importuser()  : mixed
interfaceSettings()  : mixed
JSadduser()  : mixed
JSedituser()  : mixed
NewsletterNotSendCount()  : mixed
NewsletterSendCount()  : mixed
parseConsentView()  : string
Parses the consent icons
parseNewsDetails()  : null
Parse the news details blocks
ParseNewsletter()  : mixed
Parse the newsletter
SelectListCategory()  : mixed
SelectListFields()  : mixed
SelectListStatus()  : mixed
sendConsentConfirmationMail()  : bool
Send a consent confirmation mail to users based on mailing list
showSettings()  : mixed
Parse the newsletter settings section
UserCount()  : mixed
valueFromDate()  : string
Takes a mktime()-timestamp and formats it as dd.mm.yyyy hh:mm
_getGroups()  : array<string|int, mixed>
Return the access user groups
emailEditGetCrmMembershipFilter()  : array<string|int, mixed>
Return the Crm membership filter of an email
escapeCsvValue()  : string
Escape a value that it could be inserted into a csv file.
getAttributeOfTag()  : string
Returns the value of an attribute of the specified HTML tag name
getCountryMenu()  : mixed
getCrmMembershipConditions()  : string
Returns the where condition for the filtered crm newsletter recipients
getCssAttributeOfTag()  : string
Returns the value of an attribute of the style attribute of an HTML tag
getListRecipientCount()  : int
Return the count of recipients of a list
getMailRecipientQuery()  : string
Return the recipient SQL query for a specific e-mail campaign
getNewsletterData()  : array<string|int, mixed>
Return some newsletter data
getRecipientListAssociation()  : array<string|int, mixed>
Get the list associations for all recipients.
getSetting()  : string
Return a setting from the settings table
getTmpSending()  : DBIterator
Get the emails from the tmp sending page
getUserDateTime()  : string
Get a user dateTime in H:i:s d.m.Y format from db data
getUserEditLink()  : mixed
Return the Edit link of the inform email
informAdminAboutRejectedMail()  : mixed
Inform the admin about a reject
prepareForRegExp()  : mixed
prepareNewsletterLinksForSend()  : mixed
SendEmail()  : mixed
Deliver an email campaign to a recipient
setAttributeOfTag()  : string
Sets the HTML attribute of a tag to a specified value
setCrmMembershipFilter()  : bool
Store the CRM membership filter
_getMailRecipientCount()  : mixed
emailEditGetAssociatedGroups()  : array<string|int, mixed>
Return the associated access groups of an email
emailEditParseGroups()  : mixed
Parse the groups into the mail edit page
getAllRecipientEmails()  : object
Return all email recipients
getCurrentMailRecipientCount()  : int
Return the recipient count of the emails
getFinalMailRecipientCount()  : mixed
getLinkData()  : mixed
getNewsletterUserData()  : adodb
Return the user data
getNewsletterValues()  : array<string|int, mixed>
Return the newsletter values
getTmpRecipientCount()  : int
Return the recipient count of a newsletter in the temp table
insertTmpEmail()  : mixed
Insert an email address into the email table
returnNewsletterUser()  : array<string|int, mixed>
Return all newsletter users and those access users who are assigned to the list and their information
setMailGroups()  : mixed
Associate the user groups with the mail
updateNewsletterRecipientCount()  : mixed
Update the recipient count of a newsletter

Constants

UNSUBSCRIBE_BEHAVIOR_AUTOMATIC

public mixed UNSUBSCRIBE_BEHAVIOR_AUTOMATIC = 'automatic'

Properties

$_arrMailPriority

public mixed $_arrMailPriority = array(1 => 'TXT_NEWSLETTER_VERY_HIGH', 2 => 'TXT_NEWSLETTER_HIGH', 3 => 'TXT_NEWSLETTER_MEDIUM', 4 => 'TXT_NEWSLETTER_LOW', 5 => 'TXT_NEWSLETTER_VERY_LOW')

$arrLists

List of present Lists

private static array<string|int, mixed> $arrLists = null
Tags
see
getListIdByName()
static

Methods

__construct()

PHP5 constructor

public __construct() : mixed
Tags
global

\Cx\Core\Html\Sigma

global

array $_ARRAYLANG

_addList()

Add a list with the given name and status

public static _addList(string $listName[, bool $listStatus = false ][, mixed $notificationMail = '' ]) : bool

Upon successfully adding a new list, resets the $arrLists class variable to null.

Parameters
$listName : string

The new list name

$listStatus : bool = false

The new list status, defaults to false for inactive

$notificationMail : mixed = ''
Tags
static
Return values
bool

True on success, false otherwise

_addMail()

public _addMail(mixed $subject, mixed $template, mixed $senderMail, mixed $senderName, mixed $replyMail, mixed $smtpServer, mixed $priority, mixed $arrAttachment, mixed $htmlContent) : mixed
Parameters
$subject : mixed
$template : mixed
$senderMail : mixed
$senderName : mixed
$replyMail : mixed
$smtpServer : mixed
$priority : mixed
$arrAttachment : mixed
$htmlContent : mixed

_addMailAttachment()

public _addMailAttachment(mixed $attachment[, mixed $mailId = 0 ]) : mixed
Parameters
$attachment : mixed
$mailId : mixed = 0

_addRecipient()

Add a recipient with the given parameter values and subscribe to the lists with their ID present in $arrLists

public static _addRecipient(string $email, string $uri, string $sex, mixed $salutation, string $title, string $lastname, string $firstname, mixed $position, string $company, mixed $industry_sector, string $address, string $zip, string $city, string $country, mixed $phone_office, mixed $phone_private, mixed $phone_mobile, mixed $fax, mixed $notes, string $birthday, string $status, array<string|int, mixed> $arrLists, int $language, mixed $source) : bool
Parameters
$email : string

The e-mail address

$uri : string

The website URL

$sex : string

The sex

$salutation : mixed
$title : string

The title

$lastname : string

The last name

$firstname : string

The first name

$position : mixed
$company : string

The company name

$industry_sector : mixed
$address : string

The address address

$zip : string

The ZIP

$city : string

The city

$country : string

The country ID

$phone_office : mixed
$phone_private : mixed
$phone_mobile : mixed
$fax : mixed
$notes : mixed
$birthday : string

The birth date

$status : string

The active status

$arrLists : array<string|int, mixed>

The array of subscribed list IDs

$language : int

The preferred language ID

$source : mixed
Tags
static
Return values
bool

True on success, false otherwise

_addRecipientTitle()

public _addRecipientTitle(mixed $title) : mixed
Parameters
$title : mixed

_addTemplate()

public _addTemplate(mixed $name, mixed $description, mixed $html, mixed $type) : mixed
Parameters
$name : mixed
$description : mixed
$html : mixed
$type : mixed

_checkUniqueListName()

public static _checkUniqueListName(mixed $listId, mixed $listName) : mixed
Parameters
$listId : mixed
$listName : mixed

_createDatesDropdown()

Create and select the date dropdowns for choosing the birthday

public _createDatesDropdown([array<string|int, mixed>|string $birthday = '' ]) : mixed
Parameters
$birthday : array<string|int, mixed>|string = ''

_deleteInactiveRecipients()

delete all inactice recipients

public _deleteInactiveRecipients() : void

_deleteRecipient()

public _deleteRecipient(mixed $id) : mixed
Parameters
$id : mixed

_editMail()

Add/Edit the mail template

public _editMail([bool $copy = false ]) : null
Parameters
$copy : bool = false

If true, copy the newsletter mail when mailid is not empty If false, Add/Edit the newsletter mail

Return values
null

_getAssociatedListsOfRecipient()

Returns an array of List IDs to which the recipient with the given ID is subscribed

public static _getAssociatedListsOfRecipient(int $recipientId[, bool $onlyActiveLists = true ]) : array<string|int, mixed>

On failure, or if the ID is invalid or empty, the empty array is returned.

Parameters
$recipientId : int

The recipient ID

$onlyActiveLists : bool = true

Return all lists if false, all lists otherwise. Defaults to true

Tags
static
Return values
array<string|int, mixed>

The array of subscribed List IDs on success, the empty array otherwise

_getBodyContent()

public _getBodyContent(mixed $fullContent) : mixed
Parameters
$fullContent : mixed

_getEmailsDropDown()

public _getEmailsDropDown([mixed $name = 'sendEmail' ][, mixed $selected = 0 ][, mixed $attrs = '' ]) : mixed
Parameters
$name : mixed = 'sendEmail'
$selected : mixed = 0
$attrs : mixed = ''

_getHTML()

public _getHTML([mixed $onlyId = false ]) : mixed
Parameters
$onlyId : mixed = false

_getMailPriorityMenu()

public _getMailPriorityMenu([mixed $selectedPriority = 3 ][, mixed $attributes = '' ]) : mixed
Parameters
$selectedPriority : mixed = 3
$attributes : mixed = ''

_getNewsPreviewPage()

Display the preview of the news in email template

public _getNewsPreviewPage() : null
Return values
null

_getRecipientTitleMenu()

public _getRecipientTitleMenu([mixed $selected = 0 ][, mixed $attrs = '' ]) : mixed
Parameters
$selected : mixed = 0
$attrs : mixed = ''

_getSettings()

This is a workaround for PHP 7 compatability.

public _getSettings() : mixed

As the method _getSettings was used in mixed scope.

Tags
todo

Refactor settings handling of component by migrating to \Cx\Setting

_getTemplateMenu()

public _getTemplateMenu([mixed $selectedTemplate = '' ][, mixed $attributes = '' ][, mixed $type = 'e-mail' ]) : mixed
Parameters
$selectedTemplate : mixed = ''
$attributes : mixed = ''
$type : mixed = 'e-mail'

_getTemplates()

public _getTemplates([mixed $type = 'e-mail' ]) : mixed
Parameters
$type : mixed = 'e-mail'

_isUniqueRecipientEmail()

public _isUniqueRecipientEmail(mixed $email, mixed $recipientId[, mixed $copy = false ]) : mixed
Parameters
$email : mixed
$recipientId : mixed
$copy : mixed = false

_lists()

Display the list administration page

public _lists() : mixed
Tags
access

private

global

array $_ARRAYLANG

global

ADONewConnection

_prepareNewsletterLinksForCopy()

public _prepareNewsletterLinksForCopy(mixed $MailHtmlContent) : mixed
Parameters
$MailHtmlContent : mixed

_prepareNewsletterLinksForStore()

public _prepareNewsletterLinksForStore(mixed $MailId) : mixed
Parameters
$MailId : mixed

_prepareNewsPreview()

Replace the placeholders formats

public _prepareNewsPreview(string $TemplateSource) : string
Parameters
$TemplateSource : string

template content

Return values
string

_removeMailAttachment()

public _removeMailAttachment(mixed $attachment[, mixed $mailId = 0 ]) : mixed
Parameters
$attachment : mixed
$mailId : mixed = 0

_setMailLists()

public _setMailLists(mixed $mailId, mixed $arrLists, mixed $mailSentDate) : mixed
Parameters
$mailId : mixed
$arrLists : mixed
$mailSentDate : mixed

_setRecipientLists()

Add the recipient with the given ID to all the lists with their IDs present in the array

public static _setRecipientLists(int $recipientId, array<string|int, mixed> $arrLists, string $source[, bool $setTime = false ]) : bool
Parameters
$recipientId : int

The recipient ID

$arrLists : array<string|int, mixed>

The array of list IDs to subscribe

$source : string

One of "opt-in", "backend", "api"

$setTime : bool = false

(optional) if set to true, consent is stored as confirmed

Tags
static
Return values
bool

True on success, false otherwise

_updateList()

public _updateList(mixed $listId, mixed $listName, mixed $listStatus, mixed $notificationMail) : mixed
Parameters
$listId : mixed
$listName : mixed
$listStatus : mixed
$notificationMail : mixed

_updateMail()

public _updateMail(mixed $mailId, mixed $subject, mixed $template, mixed $senderMail, mixed $senderName, mixed $replyMail, mixed $smtpServer, mixed $priority, mixed $arrAttachment, mixed $htmlContent) : mixed
Parameters
$mailId : mixed
$subject : mixed
$template : mixed
$senderMail : mixed
$senderName : mixed
$replyMail : mixed
$smtpServer : mixed
$priority : mixed
$arrAttachment : mixed
$htmlContent : mixed

_updateRecipient()

public _updateRecipient(mixed $recipientAttributeStatus, mixed $id, mixed $email, mixed $uri, mixed $sex, mixed $salutation, mixed $title, mixed $lastname, mixed $firstname, mixed $position, mixed $company, mixed $industry_sector, mixed $address, mixed $zip, mixed $city, mixed $country, mixed $phone_office, mixed $phone_private, mixed $phone_mobile, mixed $fax, mixed $notes, mixed $birthday, mixed $status, mixed $arrLists, mixed $language, mixed $source[, mixed $setTime = false ]) : mixed
Parameters
$recipientAttributeStatus : mixed
$id : mixed
$email : mixed
$uri : mixed
$sex : mixed
$salutation : mixed
$title : mixed
$lastname : mixed
$firstname : mixed
$position : mixed
$company : mixed
$industry_sector : mixed
$address : mixed
$zip : mixed
$city : mixed
$country : mixed
$phone_office : mixed
$phone_private : mixed
$phone_mobile : mixed
$fax : mixed
$notes : mixed
$birthday : mixed
$status : mixed
$arrLists : mixed
$language : mixed
$source : mixed
$setTime : mixed = false

_updateTemplate()

public _updateTemplate(mixed $id, mixed $name, mixed $description, mixed $html, mixed $type) : mixed
Parameters
$id : mixed
$name : mixed
$description : mixed
$html : mixed
$type : mixed

_userList()

public _userList() : mixed
Tags
todo

instead of just not linking the access users probably link to the access module in case the user has the appropriate rights

_validateRecipientAttributes()

public _validateRecipientAttributes(mixed $recipientAttributeStatus, mixed $recipient_website, mixed $recipient_sex, mixed $recipient_salutation, mixed $recipient_title, mixed $recipient_lastname, mixed $recipient_firstname, mixed $recipient_position, mixed $recipient_company, mixed $recipient_industry, mixed $recipient_address, mixed $recipient_zip, mixed $recipient_city, mixed $recipient_country, mixed $recipient_phone, mixed $recipient_private, mixed $recipient_mobile, mixed $recipient_fax, mixed $recipient_birthday) : mixed
Parameters
$recipientAttributeStatus : mixed
$recipient_website : mixed
$recipient_sex : mixed
$recipient_salutation : mixed
$recipient_title : mixed
$recipient_lastname : mixed
$recipient_firstname : mixed
$recipient_position : mixed
$recipient_company : mixed
$recipient_industry : mixed
$recipient_address : mixed
$recipient_zip : mixed
$recipient_city : mixed
$recipient_country : mixed
$recipient_phone : mixed
$recipient_private : mixed
$recipient_mobile : mixed
$recipient_fax : mixed
$recipient_birthday : mixed

CategoryDropDown()

public CategoryDropDown([mixed $name = 'category' ][, mixed $selected = 0 ][, mixed $attrs = '' ]) : mixed
Parameters
$name : mixed = 'category'
$selected : mixed = 0
$attrs : mixed = ''

dateFromInput()

Takes a date in the format dd.mm.yyyy hh:mm and returns it's representation as mktime()-timestamp.

public dateFromInput( $value) : long
Parameters
$value :

string

Return values
long

timestamp

dbFromDate()

Takes a mktime()-timestamp and formats it as yyyy-mm-dd hh:mm:00 for insertion in db.

public dbFromDate( $value) : string
Parameters
$value :

long timestamp

Return values
string

emailEditParseLists()

Parse the lists to be selected as email recipients

public emailEditParseLists(array<string|int, mixed> $associatedLists) : mixed
Parameters
$associatedLists : array<string|int, mixed>
Tags
author

Stefan Heinemann sh@adfinis.com

feedback()

public feedback(mixed &$users, mixed &$linkCount, mixed &$feedbackCount, mixed &$emailCount) : mixed
Parameters
$users : mixed
$linkCount : mixed
$feedbackCount : mixed
$emailCount : mixed

getListIdByName()

Returns the ID of the list specified by its name

public static getListIdByName(string $list_name) : int

Used for importing/setting up User-List relations

Parameters
$list_name : string

The List name

Return values
int

The matching list ID if found, null otherwise

getListNameById()

Get newsletter list name by given id

public getListNameById(int $listId) : mixed
Parameters
$listId : int

List id

Return values
mixed

string or null

getLists()

Returns an array of all Newsletter lists

public static getLists([mixed $excludeHiddenLists = false ][, mixed $extendedInfo = false ]) : array<string|int, mixed>
Parameters
$excludeHiddenLists : mixed = false
$extendedInfo : mixed = false
Tags
internal

Made public for mediadir and access module -- RK / TD

Return values
array<string|int, mixed>

The array of Newsletter lists

getNewsletterPlaceHoldersList()

Get available placeholders in newsletter notification mails

public getNewsletterPlaceHoldersList() : string
Return values
string

Newsletter placehodlers list

getNewsMailContent()

Get News content to send email

public getNewsMailContent(string $importTemplate, NewsLibrary $objNewsLib, object $objNews[, bool $stripTeaser = false ]) : string
Parameters
$importTemplate : string

News Template content

$objNewsLib : NewsLibrary

News library object

$objNews : object

Database Records

$stripTeaser : bool = false

Strip the Teaser text when true

Return values
string

getPage()

Set the backend page

public getPage() : mixed
Tags
access

public

global

\Cx\Core\Html\Sigma

global

array $_ARRAYLANG

GetProfileURL()

Return link to the profile of a user

public GetProfileURL(mixed $code, mixed $email[, mixed $type = self::USER_TYPE_NEWSLETTER ][, mixed $htmlTag = true ]) : mixed
Parameters
$code : mixed
$email : mixed
$type : mixed = self::USER_TYPE_NEWSLETTER
$htmlTag : mixed = true

getRecipientLocaleIdByRecipientId()

Returns the Language ID for a newsletter recipient

public getRecipientLocaleIdByRecipientId(int $id, string $type) : int

If the recipients's preferred language can not be found, the default language ID is returned.

Parameters
$id : int

id of the recipient or the linked access/crm user

$type : string

User type (see constants)

Return values
int

Language ID

getSettings()

This is a workaround for PHP 7 compatability.

public static getSettings() : mixed

As the method _getSettings was used in mixed scope.

Tags
todo

Refactor settings handling of component by migrating to \Cx\Setting

GetTemplateSource()

public GetTemplateSource(mixed $TemplateID) : mixed
Parameters
$TemplateID : mixed

GetUnsubscribeURL()

Get the URL to the page to unsubscribe

public GetUnsubscribeURL(mixed $code, mixed $email[, mixed $type = self::USER_TYPE_NEWSLETTER ][, mixed $htmlTag = true ]) : mixed
Parameters
$code : mixed
$email : mixed
$type : mixed = self::USER_TYPE_NEWSLETTER
$htmlTag : mixed = true

getUsersPreferredLanguageId()

Returns the Language ID for a newsletter user

public getUsersPreferredLanguageId(string $email, string $type) : int

If the user's preferred language can not be found, the default language ID is returned. For crm email addresses this will be the system default language by now

Parameters
$email : string

E-mail address of the user

$type : string

User type (see constants)

Return values
int

Language ID

parseConsentView()

Parses the consent icons

public static parseConsentView(string $source, string $consent) : string
Parameters
$source : string

Either "backend", "api", "opt-in", "undefined"

$consent : string

Date parseable by DateTime or empty string

Return values
string

HTML content

parseNewsDetails()

Parse the news details blocks

public parseNewsDetails(Sigma $objNewsTpl, NewsLibrary $objNewsLib, object $objNews, int &$currentCategory) : null
Parameters
$objNewsTpl : Sigma

Template object

$objNewsLib : NewsLibrary

News library object

$objNews : object

Database Records

$currentCategory : int

Current category id

Return values
null

ParseNewsletter()

Parse the newsletter

public ParseNewsletter(mixed $subject, mixed $content_text, mixed $TemplateSource, mixed $format, mixed $TargetEmail, mixed $userData, mixed $NewsletterID[, mixed $testDelivery = false ]) : mixed
Parameters
$subject : mixed
$content_text : mixed
$TemplateSource : mixed
$format : mixed
$TargetEmail : mixed
$userData : mixed
$NewsletterID : mixed
$testDelivery : mixed = false
Tags
author

Cloudrexx AG

author

Stefan Heinemann sh@adfinis.com

sendConsentConfirmationMail()

Send a consent confirmation mail to users based on mailing list

public sendConsentConfirmationMail(array<string|int, mixed> $categoryIds[, string $email = '' ]) : bool
Parameters
$categoryIds : array<string|int, mixed>

Category to send mail for

$email : string = ''

(optional) Only sends the mail to this user

Return values
bool

False if something went wrong, true otherwise

valueFromDate()

Takes a mktime()-timestamp and formats it as dd.mm.yyyy hh:mm

public valueFromDate([ $value = 0 ][, mixed $format = 'd.m.Y H:i:s' ]) : string
Parameters
$value : = 0

long timestamp

$format : mixed = 'd.m.Y H:i:s'
Return values
string

_getGroups()

Return the access user groups

protected _getGroups([string $orderBy = "`group_name`" ]) : array<string|int, mixed>
Parameters
$orderBy : string = "`group_name`"
Tags
author

Stefan Heinemann sh@adfinis.com

Return values
array<string|int, mixed>

emailEditGetCrmMembershipFilter()

Return the Crm membership filter of an email

protected emailEditGetCrmMembershipFilter(int $mail) : array<string|int, mixed>
Parameters
$mail : int
Return values
array<string|int, mixed>

escapeCsvValue()

Escape a value that it could be inserted into a csv file.

protected escapeCsvValue(string $value) : string
Parameters
$value : string
Return values
string

getAttributeOfTag()

Returns the value of an attribute of the specified HTML tag name

protected getAttributeOfTag(string $html, string $tagName, string $attributeName) : string
Parameters
$html : string

HTML to perform search in

$tagName : string

HTML tag to look for

$attributeName : string

HTML attribute to look for

Return values
string

Attribute value or empty string if not set

getCountryMenu()

protected getCountryMenu([mixed $selectedCountry = 0 ][, mixed $mantatory = false ]) : mixed
Parameters
$selectedCountry : mixed = 0
$mantatory : mixed = false

getCrmMembershipConditions()

Returns the where condition for the filtered crm newsletter recipients

protected getCrmMembershipConditions(array<string|int, mixed> $crmMembershipFilter[, bool $allowOtherNewsletterType = false ]) : string
Parameters
$crmMembershipFilter : array<string|int, mixed>

the filters for the given mail

$allowOtherNewsletterType : bool = false

check if the e-mail address is an crm address

Return values
string

the WHERE statement of the sql query

getCssAttributeOfTag()

Returns the value of an attribute of the style attribute of an HTML tag

protected getCssAttributeOfTag(string $html, string $tagName, string $cssAttributeName) : string
Parameters
$html : string

HTML to perform search in

$tagName : string

HTML tag to look for

$cssAttributeName : string

CSS attribute to look for in style attribute

Return values
string

Attribute value or empty string if not set

getListRecipientCount()

Return the count of recipients of a list

protected static getListRecipientCount(int $id) : int
Parameters
$id : int
Tags
author

Stefan Heinemann sh@adfinis.com

Return values
int

getMailRecipientQuery()

Return the recipient SQL query for a specific e-mail campaign

protected getMailRecipientQuery(int $mailId[, mixed $distinctByType = true ]) : string
Parameters
$mailId : int

The ID of the e-mail campaign to return the SQL query to fetch the recipients from

$distinctByType : mixed = true
Tags
todo

Move the query parts of $accessUserRecipientsQuery and &userGroupRecipientsQuery into a separate method as they are almost identical except for different table aliases that have to be used.

Return values
string

SQL query to fetch the recipients of the specified e-mail campaign

getNewsletterData()

Return some newsletter data

protected getNewsletterData(int $id) : array<string|int, mixed>
Parameters
$id : int
Tags
author

Stefan Heinemann sh@adfinis.com

throws
Exception
Return values
array<string|int, mixed>

array(subject, status, count, tmp_copy)

getRecipientListAssociation()

Get the list associations for all recipients.

protected getRecipientListAssociation() : array<string|int, mixed>

This method does return all recipients and their list associations as they are found in the database. This means that also inactive and non-confirmed recipients are returned. Further it will return all list associations, irrespective of the recipients consent state.

Return values
array<string|int, mixed>

The returned array will have the following structure:

[
    'newsletter_user' => [
        <recipient_id> => [
            <list_id>,
            ...
        ],
        ...
    ],
    'access_user' => [
        <recipient_id> => [
            <list_id>,
            ...
        ],
        ...
    ]
]

Note that the recipients are grouped by source type. newsletter_user refers to recipients managed directly by the Newsletter component. access_users are recipients managed by the Access component.

getSetting()

Return a setting from the settings table

protected getSetting(string $name) : string
Parameters
$name : string
Tags
author

Stefan Heinemann sh@adfinis.com

Return values
string

| bool

getUserDateTime()

Get a user dateTime in H:i:s d.m.Y format from db data

protected static getUserDateTime(string $userDateTime) : string
Parameters
$userDateTime : string

DateTime from a db

Return values
string

Return a formatted dateTime as string

Return the Edit link of the inform email

protected getUserEditLink(int $userID, const $type) : mixed
Parameters
$userID : int
$type : const
Tags
author

Stefan Heinemann sh@adfinis.com

informAdminAboutRejectedMail()

Inform the admin about a reject

protected informAdminAboutRejectedMail(int $newsletterID, int $userID, string $email, string $type, array<string|int, mixed> $newsletterUserData) : mixed

If an email could not be sent, inform the administrator about that (only if the option to do so was set)

Parameters
$newsletterID : int

Nesletter id

$userID : int

User Id

$email : string

E-mail id of the user

$type : string

User type

$newsletterUserData : array<string|int, mixed>

Info about the newsletter user

prepareForRegExp()

protected static prepareForRegExp(mixed $Text) : mixed
Parameters
$Text : mixed

prepareNewsletterLinksForSend()

protected static prepareNewsletterLinksForSend(mixed $MailId, mixed $MailHtmlContent, mixed $UserId, mixed $recipientType[, mixed $langId = null ]) : mixed
Parameters
$MailId : mixed
$MailHtmlContent : mixed
$UserId : mixed
$recipientType : mixed
$langId : mixed = null

SendEmail()

Deliver an email campaign to a recipient

protected SendEmail(int $UserID, int $NewsletterID, string $TargetEmail, bool $TmpEntry[, string $type = self::USER_TYPE_NEWSLETTER ][, bool $sealDelivery = true ]) : mixed
Parameters
$UserID : int

ID of the recipient to receive the email campaign.

$NewsletterID : int

ID of the email campaign to deliver

$TargetEmail : string

Email of the recipient to receive the email campaign.

$TmpEntry : bool

If set to TRUE, then the send operation will execute a live delivery to the recipient. Otherwise if set to FALSE, then the send operation performs a test delivery to the recipient.

$type : string = self::USER_TYPE_NEWSLETTER

Type of the recipient to receive the email campaign. One of the following:

  • NewsletterManager::USER_TYPE_NEWSLETTER (default)
  • NewsletterManager::USER_TYPE_ACCESS
  • NewsletterManager::USER_TYPE_CORE
$sealDelivery : bool = true

If set to TRUE, the email campaign will be marked as sent in the case the campaign has been delivered (or attempted to) to all recipients. If set to FALSE, the delivery check will be skipped and the campaign will not be marked as sent (in case it hasn't been so anyway already). Defaults to TRUE.

setAttributeOfTag()

Sets the HTML attribute of a tag to a specified value

protected setAttributeOfTag(string $html, string $tagName, string $attributeName, string $attributeValue) : string
Parameters
$html : string

HTML to perform search in

$tagName : string

HTML tag to look for

$attributeName : string

HTML attribute to look for

$attributeValue : string

Value to set

Return values
string

altered HTML

setCrmMembershipFilter()

Store the CRM membership filter

protected setCrmMembershipFilter(int $mailID, array<string|int, mixed> $membershipFilter, string $type, string $mailSentDate) : bool
Parameters
$mailID : int
$membershipFilter : array<string|int, mixed>
$type : string
$mailSentDate : string

sent date

Tags
author

Thomas Däppen thomas.daeppen@cloudrexx.com

Return values
bool

true if modification was made, else otherwise

_getMailRecipientCount()

private _getMailRecipientCount([mixed $mailId = null ][, mixed $limit = 0 ][, mixed $pos = 0 ]) : mixed
Parameters
$mailId : mixed = null
$limit : mixed = 0
$pos : mixed = 0

emailEditGetAssociatedGroups()

Return the associated access groups of an email

private emailEditGetAssociatedGroups(int $mail) : array<string|int, mixed>
Parameters
$mail : int
Tags
author

Stefan Heinemann sh@adfinis.com

Return values
array<string|int, mixed>

emailEditParseGroups()

Parse the groups into the mail edit page

private emailEditParseGroups([mixed $associatedGroups = array() ]) : mixed
Parameters
$associatedGroups : mixed = array()
Tags
author

Stefan Heinemann sh@adfinis.com

todo

Apparently parses one group too much

getAllRecipientEmails()

Return all email recipients

private getAllRecipientEmails(int $mailID) : object
Parameters
$mailID : int
Tags
author

Stefan Heinemann sh@adfinis.com

Return values
object

getFinalMailRecipientCount()

private getFinalMailRecipientCount([mixed $mailId = null ]) : mixed
Parameters
$mailId : mixed = null
Tags
todo

I think this should be rewritten too

getNewsletterUserData()

Return the user data

private getNewsletterUserData(int $id, string $type) : adodb
Parameters
$id : int
$type : string
Tags
author

Stefan Heinemann sh@adfinis.com

Return values
adodb

result object

getNewsletterValues()

Return the newsletter values

private getNewsletterValues(int $id) : array<string|int, mixed>
Parameters
$id : int
Return values
array<string|int, mixed>

| bool

getTmpRecipientCount()

Return the recipient count of a newsletter in the temp table

private getTmpRecipientCount(int $id) : int
Parameters
$id : int
Tags
author

Stefan Heinemann sh@adfinis.com

Return values
int

insertTmpEmail()

Insert an email address into the email table

private insertTmpEmail(int $mail, string $email, mixed $type) : mixed
Parameters
$mail : int
$email : string
$type : mixed
Tags
author

Stefan Heinemann sh@adfinis.com

returnNewsletterUser()

Return all newsletter users and those access users who are assigned to the list and their information

private returnNewsletterUser(string $where[, mixed $order = '' ][, int $newsletterListId = 0 ][, mixed $status = null ][, mixed $limit = null ][, mixed $pagingPos = 0 ]) : array<string|int, mixed>
Parameters
$where : string

The where String for searching

$order : mixed = ''
$newsletterListId : int = 0

The id of the newsletter category to be selected (0 for all users)

$status : mixed = null
$limit : mixed = null
$pagingPos : mixed = 0
Tags
author

Stefan Heinemann sh@adfinis.com

Return values
array<string|int, mixed>

array(array, int)

setMailGroups()

Associate the user groups with the mail

private setMailGroups(int $mailID, array<string|int, mixed> $groups, string $mailSentDate) : mixed

Associate the access user groups with the newsletter email.

Parameters
$mailID : int
$groups : array<string|int, mixed>
$mailSentDate : string

sent date

Tags
author

Stefan Heinemann sh@adfinis.com

updateNewsletterRecipientCount()

Update the recipient count of a newsletter

private updateNewsletterRecipientCount(int $newsletter) : mixed
Parameters
$newsletter : int
Tags
author

Stefan Heinemann sh@adfinis.com


        
On this page

Search results