class GetMailService implements GetMailServiceInterface

This service retrieves emails for the currently logged in user.

Traits

StringTranslationTrait

Properties

protected DateFormatterInterface $dateFormatter

The date formatter service.

protected GraphService $o365Graph

Drupal\o365\GraphService definition.

Methods

__construct(GraphService $o365_graph, DateFormatterInterface $dateFormatter)

Constructs a new GetMailService object.

array
generateMailList(array $mailData, string $type = 'page')

Generate a rendered list of emails.

array|bool
getMail(int $limit = 10, array $fields = [])

Get the users mails.

array|bool
getUnreadMail(int $limit = 5, array $fields = [])

Get the users unread mails.

Details

at line 41
__construct(GraphService $o365_graph, DateFormatterInterface $dateFormatter)

Constructs a new GetMailService object.

Parameters

GraphService $o365_graph

The GraphService definition.

DateFormatterInterface $dateFormatter

The date formatter service.

at line 85
array generateMailList(array $mailData, string $type = 'page')

Generate a rendered list of emails.

Parameters

array $mailData

The mail data to process.

string $type

The type of output we need so we can differentiate between pages/blocks.

Return Value

array

The render array with the list of mails.

at line 49
array|bool getMail(int $limit = 10, array $fields = [])

Get the users mails.

Parameters

int $limit

The number of mails to get.

array $fields

The fields we want to get. If empty all fields will be returned.

Return Value

array|bool

The list of mails or FALSE if no mails.

Exceptions

TempStoreException
IdentityProviderException
GraphException

at line 67
array|bool getUnreadMail(int $limit = 5, array $fields = [])

Get the users unread mails.

Parameters

int $limit

The number of mails to get.

array $fields

The fields we want to get. If empty all fields will be returned.

Return Value

array|bool

The list of mails or FALSE if no mails.

Exceptions

TempStoreException
IdentityProviderException
GraphException