Commit Graph

27 Commits

Author SHA1 Message Date
Kailash Nadh 68afd61024 Add support for alternate plaintext body for e-mails.
This commit removes the Go html2text lib that would automatically
convert all HTML messages to plaintext and add them as the alt
text body to outgoing e-mails. This lib also had memory leak
issues with certain kinds of HTML templates.

A new UI field for optionally adding an alt plaintext body to
a campaign is added. On enabling, it converts the HTML message in
the campaign editor into plaintext (using the textversionjs lib).

This introduces breaking changes in the campaigns table schema,
model, and template compilation.
2021-01-30 18:49:47 +05:30
Kailash Nadh b420c31d33 Log test message error 2021-01-28 23:30:39 +05:30
Kailash Nadh 4bfdda9b91 Load a default (en) language underneath the selected language.
The default language (en) is loaded first and the selected
language is loaded on top of it so that missing translation keys
in the selected language will have the original English strings
available on the UI.
2021-01-26 21:59:27 +05:30
Kailash Nadh 05928d57b1 Fix default campaign template not being setup on first install.
This was a ridiculous miss, where on first time installation, the
well designed default e-mail template was never installed in the
DB! I never spotted this because my local dev setup, and
surprisingly, nobody ever complained that the default campaign
template was a blank slate with no styles.
2021-01-24 12:49:52 +05:30
Kailash Nadh 027261793f Add support for rate limiting messages with a sliding window.
Certain SMTP hosts limit the total number of messages that can be
sent within a window, for instance, X / 24 hours. The concurrency
and message rate controls can only limit that to a max of
1 messages / second, without a global cap.

This commit introduces a simple sliding window rate limit feature
that counts the number of messages sent in a specific window, and
upon reaching that limit, waits for the window to reset before
any more messages are pushed out globally across any number of
campaigns.

Context: https://github.com/knadh/listmonk/issues/119
2021-01-24 12:19:26 +05:30
Kailash Nadh ee4fb7182f Refactor i18n name and fix the L() function in public HTML templates 2021-01-23 19:34:30 +05:30
Kailash Nadh 4cd5e6ebeb Refactor and remove placeholder i18n func 2021-01-23 18:54:33 +05:30
Kailash Nadh 810607e547 Fix incorrect i18n keys in message strings 2021-01-23 18:48:10 +05:30
Kailash Nadh ec1c4f30ed Add subscriber export feature 2021-01-23 18:23:29 +05:30
Kailash Nadh 3498a727f5 WIP: Add i18n support 2021-01-17 20:59:01 +05:30
Karan Sharma ad8f290dad feat: Set default values for DB connection parameters
- Configures `max_open` and `max_idle` in default configs to `25`.
  This changes the previous behaviour of connection pooling where both the
  values were unset (from default config) and causes unbounded connection
  limit and no connection reuse.
- Configures `db.SetConnMaxLifetime` which sets the maximum time the
  connection can be reused in a pool.
- Sets `max_conn_lifetime` in default config as `5 minutes`.

Closes https://github.com/knadh/listmonk/issues/225
2020-11-17 14:34:35 +05:30
Kailash Nadh cde0b4b42a Add a DB setup check on boot 2020-11-10 22:21:25 +05:30
Kailash Nadh 1e8b533d45 Fix echo's URI routing race condition that caused random 404s. 2020-11-08 18:36:25 +05:30
Kailash Nadh 1aecd6f2e1 Add serverside sort to tables.
Lists, campaigns, and subscribers tables now support server-side
sorting from the UI. This significantly changes the internal
queries from prepared to string interpolated to support dynamic
sort params.
2020-10-24 20:00:29 +05:30
Kailash Nadh a1aeba22bb Fix invalid link click registrations
The link_clicks.link_id table was NULLable incorrectly. Links that
do not exist should not register a tracking entry. Fix the query
and also update the schema + migration (breaking table change).
2020-10-24 14:03:37 +05:30
Kailash Nadh 7cecbbba34 Register missing settings/logs URL in the backend 2020-10-24 13:36:22 +05:30
Kailash Nadh e9bf47b006 Fix --version string and duplicate printing 2020-10-18 22:59:22 +05:30
Kailash Nadh 2e361c7371 Add v0.8.0 DB migrations. 2020-10-18 21:10:47 +05:30
Kailash Nadh 1b279478fb Make individual subscriber tracking optional.
A new toggle switch in Settings -> Privacy, which is off by
default, allows campaign views (pixel) and link clicks to function
without registering the subscriber ID against view and click
events, anonymising tracking. When off, the subscriber UUIDs in
view and link tracking URLs are removed, anonymising subscriber
information from HTTP logs as well.
2020-10-18 17:49:46 +05:30
Kailash Nadh 8dbe30cd26 Add new 'Logs' page to the UI to view stdout logs 2020-10-10 23:55:54 +05:30
Kailash Nadh f81d75a787 Allow deleting of all campaigns irrespective of status 2020-10-10 22:08:13 +05:30
Kailash Nadh f667935a82 Fix empty password save behaviour on settings.
The earlier logic for copying existing passwords from the DB to
SMTP and messenger settings when the frontend sent an empty
password was based on array positions (and flawed). This commit
introduces an internal UUID field to SMTP and Messenger settings
to keep track of password changes in the settings UI.
2020-10-10 21:25:59 +05:30
Kailash Nadh 6cf43ea674 Add generic HTTP postback `Messenger` support.
This is a major feature that builds upon the `Messenger` interface
that has been in listmonk since its inception (with SMTP as the only
messenger). This commit introduces a new Messenger implementation, an
HTTP "postback", that can post campaign messages as a standard JSON
payload to arbitrary HTTP servers. These servers can in turn push them
to FCM, SMS, or any or any such upstream, enabling listmonk to be a
generic campaign messenger for any type of communication, not just
e-mails.

Postback HTTP endpoints can be defined in settings and they can be
selected on campaigns.
2020-10-10 18:52:08 +05:30
Kailash Nadh 1ef1c5a61c Fix incorrect default values and server response in list creation UI 2020-08-22 14:13:13 +05:30
Kailash Nadh 0f055eacb8 Fix build scripts (and static file embed) 2020-08-09 20:02:43 +05:30
Kailash Nadh d8a60d1295 Add automatic update checks.
- A check for new versions on the GitHub releases pages happens
  once every 24 hours. When a new version is available, a notice
  is displayed on the admin UI.
2020-08-08 16:59:47 +05:30
Kailash Nadh f3e80da339 Clean up root and move app to `cmd` directory 2020-08-08 13:54:25 +05:30