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 MailerInterface $mailer, protected HtmlFormatter $html_formatter, protected ViewsService $views, protected ImageFetcherService $image_fetcher)
 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 (SymfonyEmail $message, Email $email)
 Build the body part of the e-mail message. More...
 
 addHtmlPart (SymfonyEmail $message, \Elgg\Email $email)
 Add the HTML part to 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 20 of file EmailService.php.

Constructor & Destructor Documentation

◆ __construct()

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

Constructor.

Parameters
Config$configConfig
EventsService$eventsEvents service
MailerInterface$mailerMailer
HtmlFormatter$html_formatterHtml formatter
ViewsService$viewsViews service
ImageFetcherService$image_fetcherImage fetcher

Definition at line 34 of file EmailService.php.

Member Function Documentation

◆ addHtmlPart()

Elgg\EmailService::addHtmlPart ( SymfonyEmail  $message,
\Elgg\Email  $email 
)
protected

Add the HTML part to the e-mail message.

Parameters
SymfonyEmail$messageCurrent message
\Elgg\Email$emailthe e-mail to get information from
Returns
void

Definition at line 164 of file EmailService.php.

◆ findImages()

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 310 of file EmailService.php.

◆ makeHtmlBody()

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 276 of file EmailService.php.

◆ prepareSubject()

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

Prepare the subject string.

Parameters
string$subjectinitial subject string
Returns
string

Definition at line 124 of file EmailService.php.

◆ send()

Elgg\EmailService::send ( Email  $email)

Sends an email.

Parameters
Email$emailEmail
Returns
bool
Exceptions
RuntimeException

Definition at line 52 of file EmailService.php.

◆ setMessageBody()

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

Build the body part of the e-mail message.

Parameters
SymfonyEmail$messageCurrent message
Email$emailEmail
Returns
void

Definition at line 140 of file EmailService.php.

◆ transport()

Elgg\EmailService::transport ( Email  $email)

Transports an email.

Parameters
Email$emailEmail
Returns
bool

Definition at line 74 of file EmailService.php.


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