Commit graph

28 commits

Author SHA1 Message Date
Kailash Nadh 1b017c06e0 Merge branch 'master' of github.com:knadh/listmonk 2022-02-01 23:42:36 +05:30
Kailash Nadh 2614b072f2 Refactor campaign analytics to show unique / non-unique data.
The analytics page showed non-unique counts for views and clicks which
was misleading and source of confusion: #522, #561, #571, #676, #680
This commit changes this behaviour to pull unique views and clicks when
individual subscriber tracking is turned on in settings, and non-unique
counts when it is turned off (as `subscriber_id` in `campaign_views`
and `link_clicks` will be NULL, rendering unique queries dysfunctional).

This commit changes the stats SQL queries to use string interpolation
to either to SELECT `*` or `DISTINCT subscriber_id` on app boot based
on the setting in the DB. This involves significant changes to how
queries are read and prepared on init.

- Refactor `initQueries()` to `readQueries()` and `prepareQueries()`.
- Read queries first before preparing.
- Load settings from the DB using the read settings query.
- Prepare queries next. Use the privacy setting from the DB to apply
  string interpolation to the analytics queries to pull
  unique/non-unique before preparing the queries.

On the UI:
- Show a note on the analytics page about unique/non-unique counts.
- Hide the % donut charts on the analytics page in non-unique mode.

Closes #676, closes #680
2022-02-01 23:40:03 +05:30
Sanket Saurav 0d88bd89d0
Fix spelling for "compatible" 2022-01-31 15:41:34 +05:30
Kailash Nadh 64d2c5aeb9 Add support for custom public S3 URLs. Closes #505. 2022-01-15 21:20:32 +05:30
Kailash Nadh 4ddd3e803f Add 'View in browser' link to the default email template. Closes #540. 2022-01-15 17:25:45 +05:30
Kailash Nadh c6d5d862e2 Warn of unsaved changes on the campaign editor on navigation. Closes #551. 2022-01-15 17:20:22 +05:30
Kailash Nadh 04ea18c87d Refactor opt-in confirmation behaviour in subscriber update API.
- Updating a subscriber no longer triggers an opt-in confirmation mail
  as `POST /api/subscribers/:id/optin` allows that.
- A "Send opt-in confirmation" option is added to the subscriber
  update UI.

Closes #656.
2022-01-15 15:50:13 +05:30
Kailash Nadh 583dab4bc6 Add support for per-campaign custom headers.
- Add new `headers[]` column to the campain table.
- Add new headers box to the campaign UI that takes a JSON array of
  custom headers like the headers on the SMTP settings UI.
- Headers are added to e-mails and messenger postback webhooks.
- Add cypress tests.

Closes #514.
2022-01-04 22:27:40 +05:30
Kailash Nadh dd061f56d4 Add support for direct SSL/TLS (non-STARTTLS) SMTP connections.
- Add support for TLS in `smtppool` (v0.4.0) and upgrade the lib.
- Change `tls_enabled: bool` in the settings table to string
  `tls_type: STARTTLS|TLS|none` and on the settings UI.
- Add DB migrations and schema changes to apply the field change.

Closes #504.
2022-01-03 19:28:36 +05:30
Kailash Nadh c1c2b67503 Add a link to more language packs to the language settings UI. 2021-12-18 21:50:17 +05:30
Kailash Nadh fabe06e339 Add support for custom CSS/JS in settings for admin and public pages.
This feature was originally authored by @sweetppro in PR #438.
However, since the PR ended up in an unclean state with
multiple master merges (instead of rebase) from the upstream, there are
several commits that are out of order and can can no longer be be
squashed for a clean feature merge.

This commit aggregates the changes from the original PR and applies the
following fixes on top of it.

- Add custom admin JS box to appearance UI.
- Refactor i18n language strings.
- Add handlers and migrations for the new `appearance.admin.custom_js`
  field.
- Fix migration version to `v2.1.0`
- Load custom appearance CSS/JS bytes into global constants during boot
  instead of making a DB call on every request.
- Fix and canonicalize URIs from `/api/custom*` to `/public/*.css`
  and `/admin/*.css`. Add proxy paths to yarn proxy config.
- Remove redundant HTTP handlers for different custom appearance files
  and refactor into a single handler `serveCustomApperance()`
- Fix content-type and UTF8 encoding headers for different file types.
- Fix incorrect registration of public facing custom CSS/JS handlers
  in the authenticated admin URI group.
- Fix merge conflicts in `Settings.vue`.
- Minor HTML and style fixes.
- Remove the `AppearanceEditor` component and use the existing
  `HTMLEditor` component instead.
- Add `language` prop to the `HTMLEditor` component.

Co-authored-by: SweetPPro <sweetppro@users.noreply.github.com>
2021-12-18 15:38:42 +05:30
Kailash Nadh 1c8ac0f866 Add 'preconfirm subscription' option to subscriber UI. Closes #526. 2021-10-27 20:46:37 +05:30
Kailash Nadh b163b1305b Add a "Back" button the public subscription/message page.
On a successful form submission, error message etc., check if there's
browser history and render a button that takes the user back to
a meaningful origin from the dead-end message page.

Closes #527.
2021-10-23 11:39:39 +05:30
Marcin Kunert d6703f2da7
Updated polish translations 2021-10-11 10:24:02 +02:00
Kailash Nadh 93c7c8727c Replace TinyMCE source editor with Flask HTML editor. 2021-09-27 23:11:19 +05:30
Kailash Nadh 98ed4fb384 Add a landing login page and a logout option.
BasicAuth without an explicit landing page or a logout option has
sometimes been confusing to users. This commit adds a static
landing page on / with a login link and a logout option in the admin
that "logs out" BasicAuth session by posting invalid credentials to
the server to obtain a 401.
2021-09-26 23:42:57 +05:30
Kailash Nadh d86438bde9 Introduce @TrackLink shorthand for generating tracking links.
The default `{{ TrackLink "https://listmonk.app" }}` template function
is clumsy to write and does breaks WYSIWYG editors and HTML syntax
highlighting because of the quotes. The new syntax doesn't break HTML
and is easier to write.

Eg: `<a href="https://listmonk.app@TrackLink">Link</a>`

- Introduce @TrackLink shorthand.
- Add first-class support for tracking links in the WYSIWYG (TinyMCE)
  editor by introducing an on/off checkbox on the link dialog.
- Improve default dummy campaign content to highlight this.
2021-09-26 16:03:05 +05:30
Kailash Nadh 7aee36eab1 Add support for blocklisting e-mail domains.
E-mails in the domain blocklist are disallowed on the admin UI, public
subscription forms, API, and in the bulk importer.

- Add blocklist setting that takes a list of multi-line domains on the
  Settings -> Privacy UI.
- Refactor e-mail validation in subimporter to add blocklist checking
  centrally.
- Add Cypress testr testing domain blocklist behaviour on admin
  and non-admin views.

Closes #336.
2021-09-25 15:39:09 +05:30
Kailash Nadh e71115db26 Add option to toggle sending opt-in confirmation. Closes #363. 2021-09-25 10:38:13 +05:30
Kailash Nadh 9f9425c408 Refresh i18n files. 2021-09-19 15:05:15 +05:30
Kailash Nadh 61e88681ed Add campaign analytics APIs and UI 2021-09-17 21:41:25 +05:30
Kailash Nadh d6d1883587 Add custom S3 backend support (eg: Minio) to media uploads
- Introduce a new S3 backend URL on the settings UI
- Add DB migration to populate S3 URL for existing S3 settings
- Refactor and fix URL formatting

Closes #139
2021-08-15 16:09:00 +05:30
Kailash Nadh 59c897645d Normalize i18n files with new bounce keys.
- Rename some 'settings.smtp' keys to `settings.mailserver` so that
  they can be reused across SMTP and bounce settings UIs.
2021-08-14 15:56:43 +05:30
Kailash Nadh 868fae6ac2 Refactor subsbscription status option on the import page.
- Refactor subimporter New*() funcs to take opt structs.
- Refactor and simplify Vue code.
- Remove redundant i18n entries and use existing ones.
- Remove redundant subimporter constants and use existing ones.

- Consider 'overwrite' option for subscription status as well.
- Write Cypress integration tests for the new feature.
2021-06-06 17:33:23 +05:30
Kailash Nadh 95a81d17ce Add option on UI to toggle update checks.
Closes #326
2021-05-16 16:54:55 +05:30
Kailash Nadh 97d297e18c Normalize i18n files 2021-04-21 13:53:31 +05:30
Marcin Kunert f9a2eb87f0
Finished Polish (pl) translations 2021-04-16 09:53:09 +02:00
Marcin Kunert 777a89877a
Polish translations
Work in progress
2021-04-15 23:15:40 +02:00