Documentation

Email
in package

This service is used for sending emails.

Table of Contents

Properties

$emailConfig  : array<string|int, mixed>
$renderer  : PhpRenderer
$transport  : TransportInterface

Methods

__construct()  : mixed
render()  : string
Render a template with given variables.
sendEmail()  : void
Send an email.
sendEmailAsOrgan()  : void
Send an email as a given user. The user will be added as reply-to header to the email.
sendEmailAsUser()  : void
Send an email as a given user. The user will be added as reply-to header to the email.
sendEmailAsUserToUser()  : void
Send an email as a given user. The user will be added as reply-to header to the email.
createMessageFromView()  : Message
Constructs the Message instance for a given view with given variables.

Properties

$emailConfig read-only

private array<string|int, mixed> $emailConfig

$renderer read-only

private PhpRenderer $renderer

$transport read-only

private TransportInterface $transport

Methods

__construct()

public __construct(PhpRenderer $renderer, TransportInterface $transport, array<string|int, mixed> $emailConfig) : mixed
Parameters
$renderer : PhpRenderer
$transport : TransportInterface
$emailConfig : array<string|int, mixed>
Tags
phpcsSuppress

SlevomatCodingStandard.TypeHints.ParameterTypeHint.MissingTraversableTypeHintSpecification

render()

Render a template with given variables.

public render(string $template, array<string|int, mixed> $vars) : string
Parameters
$template : string
$vars : array<string|int, mixed>
Tags
phpcsSuppress

SlevomatCodingStandard.TypeHints.ParameterTypeHint.MissingTraversableTypeHintSpecification

Return values
string

sendEmail()

Send an email.

public sendEmail(string $type, string $view, string $subject, array<string|int, mixed> $data) : void
Parameters
$type : string

Type that this email belongs to. A key in the config file for email.

$view : string

Template of the email

$subject : string

Subject of the email

$data : array<string|int, mixed>

Variables that you want to have available in the template

Tags
phpcsSuppress

SlevomatCodingStandard.TypeHints.ParameterTypeHint.MissingTraversableTypeHintSpecification

sendEmailAsOrgan()

Send an email as a given user. The user will be added as reply-to header to the email.

public sendEmailAsOrgan(string $type, string $view, string $subject, array<string|int, mixed> $data, OrganInformation $organ) : void
Parameters
$type : string

Type that this email belongs to. A key in the config file for email.

$view : string

Template of the email

$subject : string

Subject of the email

$data : array<string|int, mixed>

Variables that you want to have available in the template

$organ : OrganInformation

The organ as which the email should be sent

Tags
phpcsSuppress

SlevomatCodingStandard.TypeHints.ParameterTypeHint.MissingTraversableTypeHintSpecification

sendEmailAsUser()

Send an email as a given user. The user will be added as reply-to header to the email.

public sendEmailAsUser(string $type, string $view, string $subject, array<string|int, mixed> $data, Member $user) : void
Parameters
$type : string

Type that this email belongs to. A key in the config file for email.

$view : string

Template of the email

$subject : string

Subject of the email

$data : array<string|int, mixed>

Variables that you want to have available in the template

$user : Member

The user as which the email should be sent

Tags
phpcsSuppress

SlevomatCodingStandard.TypeHints.ParameterTypeHint.MissingTraversableTypeHintSpecification

sendEmailAsUserToUser()

Send an email as a given user. The user will be added as reply-to header to the email.

public sendEmailAsUserToUser(Member $recipient, string $view, string $subject, array<string|int, mixed> $data, Member $user) : void
Parameters
$recipient : Member

The receiver of this email

$view : string

Template of the email

$subject : string

Subject of the email

$data : array<string|int, mixed>

Variables that you want to have available in the template

$user : Member

The user as which the email should be sent

Tags
phpcsSuppress

SlevomatCodingStandard.TypeHints.ParameterTypeHint.MissingTraversableTypeHintSpecification

createMessageFromView()

Constructs the Message instance for a given view with given variables.

private createMessageFromView(string $view, array<string|int, mixed> $data) : Message
Parameters
$view : string

Template of the email

$data : array<string|int, mixed>

Variables that you want to have available in the template

Tags
phpcsSuppress

SlevomatCodingStandard.TypeHints.ParameterTypeHint.MissingTraversableTypeHintSpecification

Return values
Message

the constructed instance containing the given view as HTML body


        
On this page

Search results