Skip to content

[Share By Email] Add an optional default recipient - #558

Merged
Alkarex merged 1 commit into
FreshRSS:mainfrom
NopeCharon:share-by-email-default-recipient
Oct 27, 2026
Merged

Alkarex merged 1 commit into
FreshRSS:mainfrom
NopeCharon:share-by-email-default-recipient

Conversation

@NopeCharon

Copy link
Copy Markdown
Contributor

Summary

  • add a Default recipient email field to the Share By Email configuration page, stored in the share_by_email_default_recipient user attribute
  • prefill the To field of the sharing form with it; the field remains editable and an empty setting keeps the current behaviour
  • validate the address with PHPMailer in the same way FreshRSS core validates user email addresses (userController::validateEmailAddress()); an invalid address is rejected with the core user.email.feedback.invalid message and the previous value is kept
  • add translations for all supported languages (de, en, fr, tr), document the option in the README and bump the version to 0.5.0

Fixes #129

Validation

End-to-end on a local FreshRSS edge instance (PHP 8.2 built-in server, SQLite) with the extension enabled:

  • initial state: empty field on both the configuration page and the sharing form
  • saving bob@example.net: stored, shown on the configuration page and prefilled in the sharing form
  • saving not-an-email: redirected back to the configuration page with an error, previous value kept
  • saving o'brien&co@example.net: stored as-is and correctly HTML-escaped in both forms
  • saving carol@example.net : trimmed
  • saving an empty value: the sharing form is no longer prefilled
  • no PHP warnings or errors in the server output or FreshRSS logs

Static checks: composer run-script php-lint, composer run-script phtml-lint, phpcs, phpstan (with ../FreshRSS), and markdownlint-cli2 on the README.

Users who mostly share articles with the same address (e.g. their own
mailbox or a read-later service) have to type it again every time.

Add a "Default recipient" email field to the extension configuration,
stored in the `share_by_email_default_recipient` user attribute, and use
it to prefill the "To" field of the sharing form. The field can still be
edited before sending, and leaving the setting empty keeps the current
behaviour.

The address is validated with PHPMailer in the same way FreshRSS core
validates user email addresses; an invalid address is rejected with the
core "invalid email" message and the previous value is kept.

Add translations for all supported languages, document the option in
the README and bump the extension version to 0.5.0.

Fixes FreshRSS#129
@Alkarex

Alkarex commented Oct 27, 2026

Copy link
Copy Markdown
Member

Thanks!

@Alkarex
Alkarex merged commit e134750 into FreshRSS:main Oct 27, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Share By Email Extension: Prefill recipient's address

2 participants