Elgg  Version 5.1
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
Elgg\EmailService Class Reference

Email service. More...

Public Member Functions

 __construct (Config $config, EventsService $events, TransportInterface $mailer, HtmlFormatter $html_formatter, ViewsService $views, ImageFetcherService $image_fetcher, CssCompiler $css_compiler)
 Constructor. More...
 
 send (Email $email)
 Sends an email. More...
 
 transport (Email $email)
 Transports an email. More...
 

Protected Member Functions

 prepareSubject (string $subject)
 Prepare the subject string. More...
 
 setMessageBody (MailMessage $message, Email $email)
 Build the body part of the e-mail message. More...
 
 makeHtmlPart (\Elgg\Email $email)
 Make the html part of the e-mail message. More...
 
 makeHtmlBody (array $options=[])
 Create the HTML content for use in a HTML email part. More...
 
 findImages (string $text)
 Find img src's in text. More...
 

Protected Attributes

 $config
 
 $events
 
 $mailer
 
 $html_formatter
 
 $image_fetcher
 
 $views
 
 $css_compiler
 

Detailed Description

Email service.

Definition at line 27 of file EmailService.php.

Constructor & Destructor Documentation

Elgg\EmailService::__construct ( Config  $config,
EventsService  $events,
TransportInterface  $mailer,
HtmlFormatter  $html_formatter,
ViewsService  $views,
ImageFetcherService  $image_fetcher,
CssCompiler  $css_compiler 
)

Constructor.

Parameters
Config$configConfig
EventsService$eventsEvents service
TransportInterface$mailerMailer
HtmlFormatter$html_formatterHtml formatter
ViewsService$viewsViews service
ImageFetcherService$image_fetcherImage fetcher
CssCompiler$css_compilerCss compiler

Definition at line 77 of file EmailService.php.

Member Function Documentation

Elgg\EmailService::findImages ( string  $text)
protected

Find img src's in text.

The results contain the original quotes surrounding the image src url.

Parameters
string$textthe text to search though
Returns
string[]

Definition at line 427 of file EmailService.php.

Elgg\EmailService::makeHtmlBody ( array  $options = [])
protected

Create the HTML content for use in a HTML email part.

Parameters
array$optionsadditional options to pass through to views
Returns
string

Definition at line 395 of file EmailService.php.

Elgg\EmailService::makeHtmlPart ( \Elgg\Email  $email)
protected

Make the html part of the e-mail message.

Parameters
\Elgg\Email$emailthe e-mail to get information from
Returns

Definition at line 277 of file EmailService.php.

Elgg\EmailService::prepareSubject ( string  $subject)
protected

Prepare the subject string.

Parameters
string$subjectinitial subject string
Returns
string

Definition at line 196 of file EmailService.php.

Elgg\EmailService::send ( Email  $email)

Sends an email.

Parameters
Email$emailEmail
Returns
bool
Exceptions
RuntimeException

Definition at line 103 of file EmailService.php.

Elgg\EmailService::setMessageBody ( MailMessage  $message,
Email  $email 
)
protected

Build the body part of the e-mail message.

Parameters
MailMessage$messageCurrent message
Email$emailEmail
Returns

Definition at line 212 of file EmailService.php.

Elgg\EmailService::transport ( Email  $email)

Transports an email.

Parameters
Email$emailEmail
Returns
bool
Exceptions
RuntimeException

Definition at line 126 of file EmailService.php.

Member Data Documentation

Elgg\EmailService::$config
protected

Definition at line 34 of file EmailService.php.

Elgg\EmailService::$css_compiler
protected

Definition at line 64 of file EmailService.php.

Elgg\EmailService::$events
protected

Definition at line 39 of file EmailService.php.

Elgg\EmailService::$html_formatter
protected

Definition at line 49 of file EmailService.php.

Elgg\EmailService::$image_fetcher
protected

Definition at line 54 of file EmailService.php.

Elgg\EmailService::$mailer
protected

Definition at line 44 of file EmailService.php.

Elgg\EmailService::$views
protected

Definition at line 59 of file EmailService.php.


The documentation for this class was generated from the following file: