class ChangeRequestNotificationService implements ChangeRequestNotifierInterface (View source)

Writes the zone audit line for each change request event, then emails the reviewers of the zone when a request is filed and the requester when it is decided. Mail failures are logged and reported as false; nothing here throws to the caller, so a mail problem never blocks a request.

Constants

KIND_RECORDS

KIND_ZONE_DELETE

Methods

__construct(UserNotificationRecipientInterface $recipients, ConfigurationInterface $config, MailService $mailService, EmailTemplateService $emailTemplateService, DomainRepositoryInterface $domainRepository, PermissionService $permissions, UrlService $urlService, LoggerInterface|null $logger = null, AuditService|null $audit = null, SOARecordManagerInterface|null $soaRecords = null)

No description

void
requestFiled(ZoneChangeRequest $request)

No description

void
requestDecided(ZoneChangeRequest $request)

The request was approved (applied or failed to apply) or rejected.

void
requestCancelled(ZoneChangeRequest $request)

No description

bool
notifyRequestFiled(int $requestId, int $zoneId, string $zoneName, int $requesterId, string $requesterName, string|null $comment, string $kind)

Mail every reviewer of the zone about a newly filed request.

bool
notifyRequestDecided(int $requestId, int $zoneId, string $zoneName, int $requesterId, string $status, int $reviewerId, string|null $reviewComment)

Mail the requester about the outcome of their request.

Details

__construct(UserNotificationRecipientInterface $recipients, ConfigurationInterface $config, MailService $mailService, EmailTemplateService $emailTemplateService, DomainRepositoryInterface $domainRepository, PermissionService $permissions, UrlService $urlService, LoggerInterface|null $logger = null, AuditService|null $audit = null, SOARecordManagerInterface|null $soaRecords = null)

No description

Parameters

UserNotificationRecipientInterface $recipients
ConfigurationInterface $config
MailService $mailService
EmailTemplateService $emailTemplateService
DomainRepositoryInterface $domainRepository
PermissionService $permissions
UrlService $urlService
LoggerInterface|null $logger

Omit to discard log lines

AuditService|null $audit
SOARecordManagerInterface|null $soaRecords

void requestFiled(ZoneChangeRequest $request)

No description

Parameters

ZoneChangeRequest $request

Return Value

void

void requestDecided(ZoneChangeRequest $request)

The request was approved (applied or failed to apply) or rejected.

Parameters

ZoneChangeRequest $request

Return Value

void

void requestCancelled(ZoneChangeRequest $request)

No description

Parameters

ZoneChangeRequest $request

Return Value

void

bool notifyRequestFiled(int $requestId, int $zoneId, string $zoneName, int $requesterId, string $requesterName, string|null $comment, string $kind)

Mail every reviewer of the zone about a newly filed request.

Reviewers are the active users with an email address for whom ChangeApprovalPolicy::canReview() holds, minus the requester. This walks all active users, which is acceptable because filing a request is rare.

Parameters

int $requestId
int $zoneId
string $zoneName
int $requesterId
string $requesterName
string|null $comment
string $kind

KIND_RECORDS or KIND_ZONE_DELETE

Return Value

bool

True when at least one reviewer was mailed and no send failed

bool notifyRequestDecided(int $requestId, int $zoneId, string $zoneName, int $requesterId, string $status, int $reviewerId, string|null $reviewComment)

Mail the requester about the outcome of their request.

Parameters

int $requestId
int $zoneId
string $zoneName
int $requesterId
string $status

'approved', 'rejected' or 'failed'

int $reviewerId
string|null $reviewComment

Return Value

bool

True if the notification was sent