Package Configuration - email_notifications
The email_notifications
section allows you to define default e-mail notifications that will be created during initial installation of the package. For example, the users package creates various e-mail notifications for user registration, forgotten password, verify e-mail address, and so on.
The section consists of an array of associative arrays. Below explains all keys within each associative array,
Key | Description |
---|---|
controller | The fully qualified class name of the e-mail notification controller. See Create E-Mail Notifications Controller page for details. |
sender | Sender of the e-mail message. Generally will always be "user" or "admin" unless custom recipients have been developed in. |
recipient | Recipient of the e-mail message. Generally will always be "user" or "admin" unless custom recipients have been developed in. |
subject | Subject of the e-mail message. |
text_contents | BASE64 string consisting of the plain text body contents of the e-mail message. |
html_contents | BASE64 string consisting of the HTML body contents of the e-mail message. |
condition | An associative array defining any necessary conditional variables available within the controller. |
Example
As always, looking at the package.yml files of various base packages such as webapp and users will provide excellent examples. Below is a partial example of the users package:
-
controller: App\Users\Helpers\UserNotifications
sender: admin
recipient: user
subject: Thank you for registering with ~site_name~
text_contents: CkhpIH5mdWxsX25hbWV+LAoKVGhhbmsgeW91IGZvciByZWdpc3RlcmluZyB3aXRoIH5zaXRlX25hbWV+IGF0IH5pbnN0YWxsX3VybH4sIGFuZCB3ZSBsb29rIGZvcndhcmQgdG8gYSBsb25nIGxhc3RpbmcgYnVzaW5lc3MgcmVsYXRpb25zaGlwLiAgWW91ciBhY2NvdW50IGhhcyBiZWVuIHN1Y2Nlc3NmdWxseSBjcmVhdGVkIHdpdGggdGhlIHVzZXJuYW1lIH51c2VybmFtZX4sIGFuZCB5b3UgbWF5IG5vdyBsb2dpbiBhbmQgdGFrZSBhZHZhbnRhZ2Ugb2YgeW91ciBhY2NvdW50IGZlYXR1cmVzLgoKSWYgeW91IGV2ZXIgaGF2ZSBhbnkgcXVlc3Rpb25zLCBwbGVhc2UgZG9uJ3QgaGVzaXRhdGUgdG8gY29udGFjdCBjdXN0b21lciBzdXBwb3J0LCBhbmQgd2Ugd2lsbCBiZSBnbGFkIHRvIGFzc2lzdCB5b3UuCgpUaGFuayB5b3UsCgp+c2l0ZV9uYW1lfgp+aW5zdGFsbF91cmx+CgoKCg==
condition:
action: create
group_id:
is_active:
-
controller: App\Users\Helpers\UserNotifications
sender: user
recipient: admin
subject: New Registration -- ~site_name~
text_contents: CkEgbmV3IHVzZXIgaGFzIHJlZ2lzdGVyZWQgZm9yIH5zaXRlX25hbWV+IGF0IH5pbnN0YWxsX3VybH4uICBCZWxvdyBzaG93cyBiYXNpYyBkZXRhaWxzIG9uIHRoZSB1c2VyLgoKVXNlcm5hbWU6ICAgICAgICAgICAgICAgIH51c2VybmFtZX4KRmlyc3QgTmFtZTogICAgICAgICAgICAgIH5maXJzdF9uYW1lfgpMYXN0IE5hbWU6ICAgICAgICAgICAgICAgfmxhc3RfbmFtZX4KRnVsbCBOYW1lOiAgICAgICAgICAgICAgIH5mdWxsX25hbWV+CkUtTWFpbDogICAgICAgICAgICAgICAgICB+ZW1haWx+ClBob25lOiAgICAgICAgICAgICAgICAgICB+cGhvbmV+CkNvdW50cnk6ICAgICAgICAgICAgICAgICB+Y291bnRyeX4KSVAgQWRkcmVzczogICAgICAgICAgICAgIH5yZWdfaXB+CkRhdGUgLyBUaW1lOiAgICAgICAgICAgICB+ZGF0ZV9jcmVhdGVkfgoKLS0tIEVORCAtLS0KCgoK
condition:
action: create
group_id:
is_active: