Constants

Constants define how Newsletter behaves on specific cases which are usually not to be changed. But since WordPress works in very heterogeneous environments and sometimes people have really particular needs, those constants can be redefined (at your own risk!).

Constants are defined using the PHP define(...) syntax and they can be set in your wp-config.php file before Newsletter is loaded. The Newsletter plugin takes care to check if a constant is already set.

Note: constants cannot be redefined so if you set them in the wrong way Newsletter cannot adjust things later!

A value for a constant can be set using:

define('CONSTANT_NAME', 'value');

Please, do not play with your wp-config.php if you’re unsure on how a PHP file can be edited. Anyway always keep a backup and be prepared to upload the original copy if something goes wrong.

Inside the wp-config.php file, be sure to add the define(s) before the
/* That's all, stop editing! Happy blogging. */
line, otherwise they won’t have any effect!

What's inside

Main constants

NEWSLETTER_LIST_MAX

This sets the number of lists you can manage for your subscribers. The default value is 40.

Once the value is changed the Newsletter plugin must be deactivated and reactivated, otherwise, the database won’t be updated to make room for the new lists.

Read more about lists on this page.

NEWSLETTER_PROFILE_MAX

This sets the number of extra profile fields you can manage for your subscribers. The default value is 20.

The database could have a max record/row dimension, so if too many fields are added, the operation can fail. A check of the database table structure (wp_newsletter) is required to confirm the fields have been created.

Once the value is changed the Newsletter plugin must be deactivated and reactivated, otherwise, the database won’t be updated to make room for the new lists.

NEWSLETTER_LOG_DIR

This is the folder where Newsletter saves internal logs. The log level can be set on main settings and, usually, a log file is generated for each different component or module. Logfile names contain a secret token and are rotated monthly.

The folder name MUST NOT end with a slash.

The default value is wp-content/logs/newsletter. The folder is created if not present.

NEWSLETTER_LOG_LEVEL

This constant (ranging from 0 to 4) forces the log level of the Newsletter plugin and is applied to the core functionalities and all the addons. The log level can be set on the main settings panel but that value is ignored if the constant is defined.

NEWSLETTER_LICENSE_KEY

Can be used to set the license key instead to set it on the main settings. On the main settings page, the license key will be detected but not shown.

NEWSLETTER_MEDIA_RESIZE

If set to false blocks the internal image resize which generates pixel-perfect images when adding them to your newsletter. When the feature is disabled, images are added to newsletters as loaded in the media library (could lead to not perfect message display on some email clients).

This option is available for those who are storing the media outside the blog, for example, a CDN.

NEWSLETTER_CRON_INTERVAL

Be warned: do not ask for support if you change this value and you then have delivery issues. Changing this value does not make the delivery engine work better or the (sometimes problematic) WordPress scheduler working smoothly.

This sets the interval in seconds of the internal delivery engine. It is set by default to 300 seconds. Some people experimented with a value of 60 seconds and set up an adequate cron trigger to reduce the mail load on the SMTP server. It’s not for everyone!

NEWSLETTER_EXTENSION_UPDATE

It disables the addons (both free and commercial) update: no notification of update available will be shown. To update addons it must be removed, downloaded from the account panel, and reinstalled.

NEWSLETTER_CRON_WARNINGS

If set to true, it disables the admin side warning about the not working scheduler.

Have you ever considered going premium?

With a premium plan, you'll get whole collection of 30+ professional addons, along with a full year of updates and priority support. No automatic renewals, frequent releases and a solid 30 days refund policy.