Emails
- Installation
- Help
- Learning Cmfive
- Introduction
- Creating A Config
- The Models Folder
- Install And Migrations
- Creating Index Action
- Creating Index Template
- Creating Item Action
- Add Item Table
- Edit Item Button
- Additional Configuration
Emails
Introduction
Cmfive supports two different types of email transports to best suit your needs.
- The AWS Transport uses various AWS services to make sending email faster and more reliable. Note, to enable the AWS Transport uploads must also stored in S3. See the uploads tutorial for setup.
- The SwiftMailer transport uses the SwiftMailer library.
AWS Transport
- Add the following entries into the config.php file in the root directory of your Cmfive project.
Config::append("email", [ "layer" => "aws", ]); Config::set("admin.mail.aws", [ "queue_url" => "SQS_QUEUE_URL", "region" => "SQS_QUEUE_REGION", ]);
- If you’re developing on Cmfive locally, also add the following. Note, when system.environment is set to production AWS IAM Roles must be used to authenticate with AWS as this is best practice for security.
Config::set("admin.mail.aws.credentials", [ "key" => "IAM_KEY", "secret" => "IAM_SECRET", ]); Config::set("system.environment", "development");
-
Replace SQS_QUEUE_URL and SQS_QUEUE_REGION with their respective values as well as IAM_KEY and IAM_SECRET if system.environment is set to development.
-
Make sure to clear your config cache to apply your changes.
- Clone the Cmfive-Mail-Service-CDK repository and follow the steps outlined in the README.md file to deploy the CDK stack.
SwiftMailer Transport
- Add the following entries into the config.php file in the root directory of your Cmfive project.
Config::append("email", [ "layer" => "smtp", "command" => "", "host" => "EMAIL_HOST", "port" => PORT_NUMBER, "auth" => true, "username" => "EMAIL_USERNAME", "password" => "EMAIL_PASSWORD", ]);
-
Replace EMAIL_HOST, PORT_NUMBER, EMAIL_USERNAME and EMAIL_PASSWORD with their respective values.
- Make sure to clear your config cache to apply your changes.