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

Email service. More...

Public Member Functions

 __construct (protected Config $config, protected EventsService $events, protected TransportInterface $mailer, protected HtmlFormatter $html_formatter, protected ViewsService $views, protected ImageFetcherService $image_fetcher, protected 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...
 

Detailed Description

Email service.

Definition at line 27 of file EmailService.php.

Constructor & Destructor Documentation

Elgg\EmailService::__construct ( protected Config  $config,
protected EventsService  $events,
protected TransportInterface  $mailer,
protected HtmlFormatter  $html_formatter,
protected ViewsService  $views,
protected ImageFetcherService  $image_fetcher,
protected 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 42 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 384 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 352 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 234 of file EmailService.php.

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

Prepare the subject string.

Parameters
string$subjectinitial subject string
Returns
string

Definition at line 153 of file EmailService.php.

Elgg\EmailService::send ( Email  $email)

Sends an email.

Parameters
Email$emailEmail
Returns
bool
Exceptions
RuntimeException

Definition at line 61 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 169 of file EmailService.php.

Elgg\EmailService::transport ( Email  $email)

Transports an email.

Parameters
Email$emailEmail
Returns
bool
Exceptions
RuntimeException

Definition at line 84 of file EmailService.php.


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