Overview

Packages

  • CONTENIDO
  • Core
    • Authentication
    • Backend
    • Cache
    • CEC
    • Chain
    • ContentType
    • Database
    • Debug
    • Exception
    • Frontend
      • Search
      • URI
      • Util
    • GenericDB
      • Model
    • GUI
      • HTML
    • I18N
    • LayoutHandler
    • Log
    • Security
    • Session
    • Util
    • Validation
    • Versioning
    • XML
  • Module
    • ContentRssCreator
    • ContentSitemapHtml
    • ContentSitemapXml
    • ContentUserForum
    • NavigationTop
    • ScriptCookieDirective
  • mpAutoloaderClassMap
  • None
  • Plugin
    • ContentAllocation
    • CronjobOverview
    • FormAssistant
    • FrontendLogic
    • FrontendUsers
    • Linkchecker
    • ModRewrite
    • Newsletter
    • Repository
      • FrontendNavigation
      • KeywordDensity
    • SearchSolr
    • SmartyWrapper
    • UrlShortener
    • UserForum
    • Workflow
  • PluginManager
  • Setup
    • Form
    • GUI
    • Helper
      • Environment
      • Filesystem
      • MySQL
      • PHP
    • UpgradeJob

Classes

  • cAjaxRequest
  • cAutoload
  • cBackend
  • cEffectiveSetting
  • cGuiScrollListAlltranslations
  • cHTMLValidator
  • cMailer
  • cModuleFileTranslation
  • cModuleHandler
  • cModuleSearch
  • cModuleSynchronizer
  • cModuleTemplateHandler
  • CodeMirror
  • cPasswordRequest
  • cPermission
  • cRegistry
  • cSystemPurge
  • cSystemtest
  • cTinymce4Configuration
  • cTinyMCE4Editor
  • cTinyMCEEditor
  • cWYSIWYGEditor
  • FrontendList
  • HtmlParser
  • TODOBackendList
  • TreeItem
  • UploadList
  • UploadSearchResultList

Functions

  • addArtspec
  • addSortImages
  • backToMainArea
  • buildArticleSelect
  • buildCategorySelect
  • buildCategorySelectRights
  • buildHeapTable
  • buildStackString
  • buildTree
  • buildUserOrGroupPermsFromRequest
  • callPluginStore
  • cApiCatGetLevelNode
  • cApiImageCheckCachedImageValidity
  • cApiImageCheckImageEditingPosibility
  • cApiImageGetCacheFileName
  • cApiImageGetTargetDimensions
  • cApiImageIsAnimGif
  • cApiImgScale
  • cApiImgScaleGetMD5CacheFile
  • cApiImgScaleHQ
  • cApiImgScaleImageMagick
  • cApiImgScaleLQ
  • cApiIsImageMagickAvailable
  • cApiStrCleanURLCharacters
  • cApiStrNormalizeLineEndings
  • cApiStrRecodeString
  • cApiStrReplaceDiacritics
  • cApiStrTrimAfterWord
  • cApiStrTrimHard
  • cApiStrTrimSentence
  • cDeprecated
  • cDie
  • cError
  • checkLangInClients
  • checkPathInformation
  • cInclude
  • compareUrlStrings
  • conChangeTemplateForCat
  • conCopyArticle
  • conCopyArtLang
  • conCopyContainerConf
  • conCopyContent
  • conCopyMetaTags
  • conCopyTemplateConfiguration
  • conCreateLocationString
  • conDeeperCategoriesArray
  • conDeleteart
  • conEditArt
  • conEditFirstTime
  • conFetchCategoryTree
  • conFlagOnOffline
  • conGenerateCode
  • conGenerateCodeForAllArts
  • conGenerateCodeForAllArtsInCategory
  • conGenerateCodeForAllartsUsingLayout
  • conGenerateCodeForAllartsUsingMod
  • conGenerateCodeForAllArtsUsingTemplate
  • conGenerateCodeForArtInAllCategories
  • conGenerateCodeForClient
  • conGenerateKeywords
  • conGetAvailableMetaTagTypes
  • conGetCategoryArticleId
  • conGetCategoryAssignments
  • conGetContainerConfiguration
  • conGetContentFromArticle
  • conGetHtmlTranslationTable
  • conGetMetaValue
  • conGetTemplateConfigurationIdForArticle
  • conGetTemplateConfigurationIdForCategory
  • conGetTopmostCat
  • conGetUsedModules
  • conHtmlentities
  • conHtmlEntityDecode
  • conHtmlSpecialChars
  • conIsLocked
  • conLock
  • conLockBulkEditing
  • conMakeArticleIndex
  • conMakeCatOnline
  • conMakeInlineScript
  • conMakeOnline
  • conMakeOnlineBulkEditing
  • conMakePublic
  • conMakeStart
  • conMoveArticles
  • conPhp54Check
  • conRemoveOldCategoryArticle
  • conSaveContentEntry
  • conSetCodeFlag
  • conSetCodeFlagBulkEditing
  • conSetMetaValue
  • conSyncArticle
  • copyRightsForElement
  • createBulkEditingFunction
  • createRandomName
  • createRightsForElement
  • cWarning
  • dbGetColumns
  • dbGetIndexes
  • dbGetPrimaryKeyName
  • dbTableExists
  • dbUpgradeTable
  • defineIfNotDefined
  • deleteArtspec
  • deleteRightsForElement
  • deleteSystemProperty
  • displayDatetime
  • emptyLogFile
  • endAndLogTiming
  • extractNumber
  • generateDisplayFilePath
  • generateJs
  • getAllClientsAndLanguages
  • getArtLang
  • getArtspec
  • getAvailableContentTypes
  • getCanonicalDay
  • getCanonicalMonth
  • getDirectorySize
  • getEffectiveSetting
  • getEffectiveSettingsByType
  • getEncodingByLanguage
  • getFileContents
  • getFileInformation
  • getFileType
  • getGroupOrUserName
  • getIDForArea
  • getJsHelpContext
  • getLanguageNamesByClient
  • getLanguagesByClient
  • getmicrotime
  • getNamedFrame
  • getParam
  • getParentAreaId
  • getSearchResults
  • getStrExpandCollapseButton
  • getSystemProperties
  • getSystemPropertiesByType
  • getSystemProperty
  • getTemplateSelect
  • getUplExpandCollapseButton
  • htmldecode
  • htmlentities_iso88592
  • humanReadableSize
  • includePlugins
  • insertEmptyStrRow
  • ipMatch
  • isAlphanumeric
  • isArchive
  • isArtInMultipleUse
  • isFunctionDisabled
  • isGroup
  • isIPv4
  • isRunningFromWeb
  • isStartArticle
  • isUtf8
  • isValidMail
  • langActivateDeactivateLanguage
  • langDeleteLanguage
  • langEditLanguage
  • langGetTextDirection
  • langNewLanguage
  • langRenameLanguage
  • layDeleteLayout
  • layEditLayout
  • machineReadableSize
  • mailLogBulkEditingFunctions
  • mailLogDecodeAddresses
  • markSubMenuItem
  • mask
  • modDeleteModule
  • modEditModule
  • phpInfoToHtml
  • plugin_include
  • prCreateURLNameLocationString
  • prDeleteCacheFileContent
  • prGetCacheFileContent
  • prResolvePathViaCategoryNames
  • prResolvePathViaURLNames
  • prWriteCacheFileContent
  • putFileContents
  • recursiveCopy
  • removeFileInformation
  • renderBackendBreadcrumb
  • renderLabel
  • renderSelectProperty
  • renderTextProperty
  • saveGroupRights
  • saveRights
  • scanDirectory
  • scanPlugins
  • sendEncodingHeader
  • set_magic_quotes_gpc
  • setArtspecDefault
  • setArtspecOnline
  • setSystemProperty
  • showTree
  • startTiming
  • statCreateLocationString
  • statDisplayTopChooser
  • statDisplayYearlyTopChooser
  • statGetAvailableMonths
  • statGetAvailableYears
  • statResetStatistic
  • statsArchive
  • statsDisplayInfo
  • statsOverviewAll
  • statsOverviewTop
  • statsOverviewTopYear
  • statsOverviewYear
  • strAssignTemplate
  • strBuildSqlValues
  • strCheckTreeForErrors
  • strCopyCategory
  • strCopyTree
  • strDeeperCategoriesArray
  • strDeleteCategory
  • strHasArticles
  • strHasStartArticle
  • strMakePublic
  • strMakeVisible
  • strMoveCatTargetallowed
  • strMoveDownCategory
  • strMoveSubtree
  • strMoveUpCategory
  • strNewCategory
  • strNewTree
  • strNextBackwards
  • strNextDeeper
  • strNextDeeperAll
  • strNextPost
  • strOrderedPostTreeList
  • strRemakeTreeTable
  • strRenameCategory
  • strRenameCategoryAlias
  • strSortPrePost
  • strSyncCategory
  • systemHavePerm
  • tplAutoFillModules
  • tplBrowseLayoutForContainers
  • tplcfgDuplicate
  • tplDeleteTemplate
  • tplDuplicateTemplate
  • tplEditTemplate
  • tplGetContainerDefault
  • tplGetContainerMode
  • tplGetContainerName
  • tplGetContainerNumbersInLayout
  • tplGetContainerTypes
  • tplGetInUsedData
  • tplIsTemplateInUse
  • tplPreparseLayout
  • tplProcessSendContainerConfiguration
  • updateClientCache
  • updateFileInformation
  • uplCreateFriendlyName
  • uplDirectoryListRecursive
  • uplGetDirectoriesToExclude
  • uplGetFileExtension
  • uplGetFileIcon
  • uplGetFileTypeDescription
  • uplGetThumbnail
  • uplHasFiles
  • uplHasSubdirs
  • uplmkdir
  • uplRecursiveDBDirectoryList
  • uplRecursiveDirectoryList
  • uplRenameDirectory
  • uplSearch
  • uplSyncDirectory
  • uplSyncDirectoryDBFS
  • Overview
  • Package
  • Class
  • Tree
  • Deprecated
  • Todo

Class cMailer

Mailer class for all mail sending purposes.

The class cMailer is a facade for the SwiftMailer library that simplifies the process of sending mails by providing some convenience methods.

<strong>Simple example</strong>

$mailer = new cMailer();
$mailer->sendMail(null, 'recipient@contenido.org', 'subject', 'body');

<strong>Default sender of mails</strong> When sending a mail using the sendMail() method of the cMailer class you can give a mail sender as first parameter. This can either be an email address as string or an array with the email address as key and the senders name as value. If you pass an empty value instead the default mail sender is used. This default mail sender can be configured with the system properties system/mail_sender and system/mail_sender_name. If no default mail sender is configured it defaults to "noreply@contenido.org" and "CONTENIDO Backend".

<strong>User defined mail sender example</strong>

$mailer->sendMail('sender@contenido.org', 'recipient@contenido.org', 'subject');
$mailer->sendMail(array('sender@contenido.org' => 'sender name'), 'recipient@contenido.org', 'subject');

<strong>Logging mails</strong>

Swift_Mailer
Extended by cMailer
Package: Core\Backend
Copyright: four for business AG <www.4fb.de>
License: http://www.contenido.org/license/LIZENZ.txt
Author: Rusmir Jusufovic
Author: Simon Sprankel
Todo: explain logging of mails via _logMail() <strong>Resending mails</strong>
Todo: explain resending of mails via resendMail() <strong>Sending user created messages</strong> Creating your own message is e.g. necessary in order to send mails with attachments as the simplified interface the cMailer class offers does not yet provide means to do so.
Todo: explain sending of user created messages via send() <strong>Default transport</strong> By default the cMailer tries to use an SMTP transport with optional authentication. If starting the SMTP transport fails, a simple MAIL transport will be used (using PHP's mail() function). <strong>User defined transport</strong> When creating a cMailer instance an arbitrary transport can be given to override the afore mentioned behaviour. <strong>User defined transport example</strong> <code>
Todo: add example </code> <strong>User defined character set</strong>
Todo: explain setCharset()
Located at classes/class.mailer.php
Methods summary
public
# __construct( Swift_Transport $transport = NULL )

Constructor to create an instance of this class.

Constructor to create an instance of this class.

System properties to define the default mail sender are read and aggregated.

An arbitrary transport instance of class Swift_Transport can be given. If no transport is given, system properties to build a transport are read and aggregated and eventually a transport is created using constructTransport().

Parameters

$transport
Swift_Transport
$transport [optional] a transport instance

Todo

add type hinting!
public static Swift_Transport
# constructTransport( string $mailHost, string $mailPort, string $mailEncryption = NULL, string $mailUser = NULL, string $mailPass = NULL )

This factory method tries to establish an SMTP connection to the given mail host. If an optional mail host user is given it is used to authenticate at the mail host. On success a SMTP transport instance is returned. On failure a simple MAIL transport instance is created and returned which will use PHP's mail() function to send mails.

This factory method tries to establish an SMTP connection to the given mail host. If an optional mail host user is given it is used to authenticate at the mail host. On success a SMTP transport instance is returned. On failure a simple MAIL transport instance is created and returned which will use PHP's mail() function to send mails.

Parameters

$mailHost
string
$mailHost the mail host
$mailPort
string
$mailPort the mail port
$mailEncryption
string
$mailEncryption [optional] the mail encryption, none by default
$mailUser
string
$mailUser [optional] the mail user, none by default
$mailPass
string
$mailPass [optional] the mail password, none by default

Returns

Swift_Transport
the transport object

Todo

making this a static method and passing all the params is not that smart!
public
# setCharset( string $charset )

Sets the charset of the messages which are sent by this mailer. If you want to use UTF-8, you do not need to call this method.

Sets the charset of the messages which are sent by this mailer. If you want to use UTF-8, you do not need to call this method.

Parameters

$charset
string
$charset the character encoding
public integer
# sendMail( string|array $from, string|array $to, string $subject, string $body = '', string|array $cc = NULL, string|array $bcc = NULL, string|array $replyTo = NULL, boolean $resend = false, string $contentType = 'text/plain' )

Wrapper function for sending a mail.

Wrapper function for sending a mail.

All parameters which accept mail addresses also accept an array where the key is the email address and the value is the name.

Parameters

$from
string|array
$from the sender of the mail, if something "empty" is given, default address from CONTENIDO system settings is used
$to
string|array
$to one or more recipient addresses
$subject
string
$subject the subject of the mail
$body
string
$body [optional] the body of the mail
$cc
string|array
$cc [optional] one or more recipient addresses which should get a normal copy
$bcc
string|array
$bcc [optional] one or more recipient addresses which should get a blind copy
$replyTo
string|array
$replyTo [optional] address to which replies should be sent
$resend
boolean
$resend [optional] whether the mail is resent
$contentType
string
$contentType [optional] MIME type to use for mail, defaults to 'text/plain'

Returns

integer
number of recipients to which the mail has been sent
public integer
# send( Swift_Mime_Message $message, array & $failedRecipients = NULL, boolean $resend = false )

Sends the given Swift_Mime_Message and logs it if $resend is false.

Sends the given Swift_Mime_Message and logs it if $resend is false.

Parameters

$message
Swift_Mime_Message
$message the message to send
$failedRecipients
array
&$failedRecipients [optional] list of recipients for which the sending has failed
$resend
boolean
$resend [optional] if this mail is send via resend when resending a mail it is not logged again

Returns

integer

See

Swift_Mailer::send()
public
# resendMail( integer $idmailsuccess )

Resends the mail with the given idmailsuccess.

Resends the mail with the given idmailsuccess.

Parameters

$idmailsuccess
integer
$idmailsuccess ID of the mail which should be resend

Throws

cInvalidArgumentException
if the mail has already been sent successfully or does not exist
private string|array
# encodeField( string|array $value, string $charset )

Encodes the given value / array of values using conHtmlEntities().

Encodes the given value / array of values using conHtmlEntities().

Parameters

$value
string|array
$value the value to encode
$charset
string
$charset the charset to use

Returns

string|array
encoded value

Todo

check why conHtmlEntities() is called w/ 4 params
private string|array
# decodeField( string|array $value, string $charset )

Decodes the given value / array of values using conHtmlEntityDecode().

Decodes the given value / array of values using conHtmlEntityDecode().

Parameters

$value
string|array
$value the value to decode
$charset
string
$charset the charset to use

Returns

string|array
decoded value

Todo

check why conHtmlEntityDecode() is called w/ 4 params
private string|boolean
# _logMail( Swift_Mime_Message $message, array $failedRecipients = array() )

Log the information about sending the email.

Log the information about sending the email.

Parameters

$message
Swift_Message
$message the message which has been send
$failedRecipients
array
$failedRecipients [optional] the recipient addresses that did not get the mail

Returns

string|boolean
the idmail of the inserted table row in con_mail_log|bool false if mail_log option is inactive
Properties summary
private string $_mailSender 'noreply@contenido.org'
#

Mail address of the default mail sender. This will be read from system property system/mail_sender. Can be overriden by giving a sender when sending a mail.

Mail address of the default mail sender. This will be read from system property system/mail_sender. Can be overriden by giving a sender when sending a mail.

private string $_mailSenderName 'CONTENIDO Backend'
#

Name of the default mail sender. This will be read from system property system/mail_sender_name. Can be overriden by giving a sender when sending a mail.

Name of the default mail sender. This will be read from system property system/mail_sender_name. Can be overriden by giving a sender when sending a mail.

private string $_mailHost 'localhost'
#

Name of the mail host. This will be read from system property system/mail_host.

Name of the mail host. This will be read from system property system/mail_host.

private integer $_mailPort 25
#

Port of the mail host. This will be read from system property system/mail_port.

Port of the mail host. This will be read from system property system/mail_port.

private string $_mailEncryption NULL
#

The mail encryption method (ssl/tls). This will be read from system property system/mail_encryption.

The mail encryption method (ssl/tls). This will be read from system property system/mail_encryption.

private string $_mailUser ''
#

Name of the mail host user. This will be read from system property system/mail_user. Used for authentication at the mail host.

Name of the mail host user. This will be read from system property system/mail_user. Used for authentication at the mail host.

private string $_mailPass ''
#

Password of the mail host user. This will be read from system property system/mail_pass. Used for authentication at the mail host.

Password of the mail host user. This will be read from system property system/mail_pass. Used for authentication at the mail host.

CMS CONTENIDO 4.9.11 API documentation generated by ApiGen 2.8.0