CoolCMS API

AdvertEmailTrait

Transactional e-mails of an advert (confirmation / approval after insert, edit notice).

Links are built by PresenterContext::absoluteLink(), so the host comes from the site.baseUrl setting, not from the request Host header.

IMPORTANT: the management password is never passed to the template (the front end does not put it into $meta). An inserter without an account gets, in editAdvertLink, a link with a manageKey that opens management without a password while it is valid (ManageKeyTrait).

Tags
requires

AdvertManager expects:

  • getPresenterContext() (PresenterTrait)
  • $languageContext (LanguageTrait)
  • $emailManager->sendEmail(...) (EmailManager)
  • issueManageKey() (ManageKeyTrait)

Table of Contents

Methods

sendEditationNotice()  : void
Sends the "advert was edited" e-mail to the advertiser after a successful edit.
sendEmail()  : void

Methods

sendEditationNotice()

Sends the "advert was edited" e-mail to the advertiser after a successful edit.

private sendEditationNotice(Advert $entity, array<string, mixed> $meta, string $emailKey) : void

Loads the advert fresh with its parameters (the in-memory entity from save has rels without keys, so the name would be empty). Nothing is sent without an advert e-mail.

Parameters
$entity : Advert
$meta : array<string, mixed>
$emailKey : string

sendEmail()

private sendEmail(Advert $advert, array<string, mixed> $meta, string $emailKey) : void
Parameters
$advert : Advert
$meta : array<string, mixed>
$emailKey : string
On this page

Search results