This is a collection a Craft utilities to ease custom development on Craft CMS.
This base class for custom modules aims at making less painful to create a Craft module. Most of the time, all you have to do to register/customize the following components is to override the corresponding getter:
- translation category (reasonable default value provided)
- CP template roots (reasonable default value provided)
- site template roots (reasonable default value provided)
- twig extensions
- CP nav items
- CP routes
- site routes
- User permissions
- Craft variables additions
- element types
- view hooks
If you need to further optimize your code, it's easy to get rid of this module and register the components the traditional way.
This simple module lets you configure the Craft mailer component using environment variables.
Set the mailer transport adapter using the NST_MAILER_TRANSPORT_TYPE
environment variable.
Supported values: smtp
, mailchimp
(mandrill
is also accepted, but it is deprecated) or mailjet
.
Depending on the adapter you choose, different environments variables are needed to configure the adapter.
NST_MAILER_FROM_NAME
: required — the name used in theFrom:
header of outgoing emailsNST_MAILER_FROM_EMAIL
: required — the email used in theFrom:
header of outgoing emails
NST_MAILER_SMTP_HOST
: required — the SMTP server hostnameNST_MAILER_SMTP_PORT
: required — the SMTP server port numberNST_MAILER_SMTP_USE_AUTHENTICATION
: boolean — whether the SMTP server requires authenticationNST_MAILER_SMTP_USERNAME
: required ifNST_MAILER_SMTP_USE_AUTHENTICATION
— the SMTP usernameNST_MAILER_SMTP_PASSWORD
: required ifNST_MAILER_SMTP_USE_AUTHENTICATION
— the SMTP passwordNST_MAILER_SMTP_ENCRYPTION
: the SMTP encryption method. Eithertls
orssl
In order to use this adapter, the mailchimp-transactional
plugin must be installed.
See the documentation of the mailchimp-transactional
plugin for details on the settings
mapped to these environment variables.
NST_MAILER_MAILCHIMP_API_KEY
: required — the value of themailchimp-transactional
pluginapiKey
settingNST_MAILER_MAILCHIMP_SUBACCOUNT
: the value of themailchimp-transactional
pluginsubaccount
settingNST_MAILER_MAILCHIMP_TEMPLATE
: the value of themailchimp-transactional
plugintemplate
setting
In order to use this adapter, the mailjet
plugin must be installed.
See the documentation of the mailjet
plugin for details on the settings
mapped to these environment variables.
NST_MAILER_MAILJET_API_KEY
: required — the value of themailjet
pluginapiKey
settingNST_MAILER_MAILJET_API_SECRET
: required — the value of themailjet
pluginapiSecret
setting