Configuration
Learn how to configure JSX Mail for your project.
Your JSX Mail project configuration is centralized in the jsx-mail.config.js
file, situated at the root of your project. This file is essential for defining project-specific settings for JSX Mail.
Example Configuration File
This sample configuration file sets the basic parameter dir
, indicating the directory where your mail files reside.
Configurable Parameters
You have the flexibility to tailor your jsx-mail.config.js
with various parameters to fit your project needs. Below are the available settings you can define:
-
dir
: Specifies the directory containing your mail templates. Default is'mail'
. -
storage
: Chooses the storage location for images. Options includeS3
for aws s3 storage,LOCAL
for local storage andJSX_MAIL_CLOUD
for JSX Mail’s default cloud storage. Default isJSX_MAIL_CLOUD
. -
onProcessChange
: A callback function triggered during each status update in theprepare
command. This function receives details about the current process event and related data. -
baseImagePath
: Just whenstorage
isLOCAL
, this parameter is required and allows you to specify a base path for storing images for your rendered template. -
defaultSender
: This parameter allows you to specify a default sender from your JSX Mail Cloud senders for sending emails. If you do not send emails using JSX Mail, this setting is optional. However, if you do send emails, you must either set this parameter or ensure that at least one sender is created in your JSX Mail Cloud. If you do not specify a sender, JSX Mail will automatically use the first available sender from your JSX Mail Cloud. You can set the sender when using thesend
function by including thesender
parameter. -
AWS Configuration (Used with
S3
storage option):awsAccessKeyId
: Your Amazon Web Services (AWS) Access Key ID.awsBucket
: The AWS bucket designated for image storage.awsFolder
: The specific folder within your AWS bucket for storing images.awsRegion
: The AWS region for your storage.awsSecretAccessKey
: Your AWS Secret Access Key.
These settings allow you to customize the behavior of JSX Mail, ensuring it aligns with your project’s requirements and infrastructure.