Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ShareByEmail extension: config update #264

Merged
merged 12 commits into from
Dec 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion xExtension-ShareByEmail/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,18 @@

This FreshRSS extension allows to share articles by email, in a more powerful way than the simple `mailto` solution.

## How to install

To install this extension, you must upload this directory in your `./extensions` directory and enable it on the extension panel in FreshRSS.

You’ll have to configure the mailing system in FreshRSS. [See the documentation](https://freshrss.github.io/FreshRSS/en/admins/05_Configuring_email_validation.html#configure-the-smtp-server)
## How to configure

After the installation the `Email` sharing service will added to the list of available sharing services. You need to add the `Email` sharing service to your individual sharing service list before it is available in the sharing menu.

You will have to configure the mailing system in FreshRSS. [See the documentation](https://freshrss.github.io/FreshRSS/en/admins/05_Configuring_email_validation.html#configure-the-smtp-server)

## Changelog

- 0.3.0 detail information about the mail system shown in the extension config
- 0.2.3 Turkish language support added
- 0.1 initial version
17 changes: 17 additions & 0 deletions xExtension-ShareByEmail/configure.phtml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?php
declare(strict_types=1);
?>

<div class="form-group">
<label class="group-name" for="words_list">
<?= _t('shareByEmail.share.manage.mailer') ?>
</label>
<div class="group-controls">
<?= match (FreshRSS_Context::systemConf()->mailer) {
'mail' => _t('shareByEmail.share.manage.mail'),
'smtp' => _t('shareByEmail.share.manage.smtp', FreshRSS_Context::systemConf()->smtp['from']),
default => _t('shareByEmail.share.manage.error')
} ?>
<p class="help"><?= _i('help') ?> <?= _t('shareByEmail.share.manage.help') ?></a></p>
</div>
</div>
7 changes: 7 additions & 0 deletions xExtension-ShareByEmail/i18n/de/shareByEmail.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,12 @@
],
'intro' => 'Diesen Artikel per Mail versenden: “<strong>%s</strong>”',
'title' => 'Einen Artikel per Mail teilen.',
'manage' => [
'mailer' => 'E-Mail-Versand',
'mail' => 'via PHP <code>mail()</code>',
'smtp' => 'via SMTP (versendet von %s)',
'error' => 'Fehler',
'help' => 'Versand zwischen PHP <code>mail()</code> und SMTP in <kbd>config.php</kbd> wechseln: siehe <a href="https://freshrss.github.io/FreshRSS/en/admins/05_Configuring_email_validation.html#configure-the-smtp-server" target="_blank">Dokumentation</a>',
]
],
];
7 changes: 7 additions & 0 deletions xExtension-ShareByEmail/i18n/en/shareByEmail.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,12 @@
],
'intro' => 'You are about to share this article by email: “<strong>%s</strong>”',
'title' => 'Share an article by email',
'manage' => [
'mailer' => 'Mailing system',
'mail' => 'PHP <code>mail()</code>',
'smtp' => 'SMTP (send from %s)',
'error' => 'Error',
'help' => 'Switch PHP <code>mail()</code>/SMTP connection in <kbd>config.php</kbd>: see <a href="https://freshrss.github.io/FreshRSS/en/admins/05_Configuring_email_validation.html#configure-the-smtp-server" target="_blank">documentation</a>'
],
],
];
7 changes: 7 additions & 0 deletions xExtension-ShareByEmail/i18n/fr/shareByEmail.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,12 @@
],
'intro' => 'Vous êtes sur le point de partager cet article par courriel : « <strong>%s</strong> »',
'title' => 'Partager un article par courriel',
'manage' => [
'mailer' => 'Système de messagerie',
'mail' => 'PHP <code>mail()</code>',
'smtp' => 'SMTP (envoyer en tant que %s)',
'error' => 'Erreur',
'help' => 'Éditer les paramètres SMTP ou PHP <code>mail()</code> dans <kbd>config.php</kbd> : voir <a href="https://freshrss.github.io/FreshRSS/en/admins/05_Configuring_email_validation.html#configure-the-smtp-server" target="_blank">la documentation</a>',
]
],
];
7 changes: 7 additions & 0 deletions xExtension-ShareByEmail/i18n/tr/shareByEmail.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,12 @@
],
'intro' => 'Bu makaleyi e-posta yoluyla paylaşmak üzeresiniz: “<strong>%s</strong>”',
'title' => 'Bir makaleyi e-posta ile paylaşın',
'manage' => [
'mailer' => 'Mailing system', // TODO
'mail' => 'PHP <code>mail()</code>', // TODO
'smtp' => 'SMTP (send from %s)', // TODO
'error' => 'Error', // TODO
'help' => 'Switch PHP <code>mail()</code>/SMTP connection in <kbd>config.php</kbd>: see <a href="https://freshrss.github.io/FreshRSS/en/admins/05_Configuring_email_validation.html#configure-the-smtp-server" target="_blank">documentation</a>', // TODO
]
],
];
12 changes: 6 additions & 6 deletions xExtension-ShareByEmail/metadata.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"name": "Share By Email",
"author": "Marien Fressinaud",
"description": "Improve the sharing by email system.",
"version": "0.2.3",
"entrypoint": "ShareByEmail",
"type": "user"
"name": "Share By Email",
"author": "Marien Fressinaud",
"description": "Improve the sharing by email system.",
"version": "0.3.0",
"entrypoint": "ShareByEmail",
"type": "user"
}
122 changes: 61 additions & 61 deletions xExtension-ShareByEmail/views/shareByEmail/share.phtml
Original file line number Diff line number Diff line change
Expand Up @@ -3,75 +3,75 @@
/** @var ShareByEmail\mailers\View $this */
?>
<div class="post">
<h1><?= _t('shareByEmail.share.title') ?></h1>
<h1><?= _t('shareByEmail.share.title') ?></h1>

<p>
<?= _t('shareByEmail.share.intro', isset($this->entry) ? $this->entry->title() : '') ?>
</p>
<p>
<?= _t('shareByEmail.share.intro', isset($this->entry) ? $this->entry->title() : '') ?>
</p>

<form class="sbe-form-share" method="POST">
<input type="hidden" name="_csrf" value="<?= FreshRSS_Auth::csrfToken() ?>" />
<form class="sbe-form-share" method="POST">
<input type="hidden" name="_csrf" value="<?= FreshRSS_Auth::csrfToken() ?>" />

<div class="form-group">
<label class="group-name" for="to">
<?= _t('shareByEmail.share.form.to') ?>
</label>
<div class="form-group">
<label class="group-name" for="to">
<?= _t('shareByEmail.share.form.to') ?>
</label>

<div class="group-controls">
<input
type="email"
name="to"
id="to"
class="long"
placeholder="[email protected]"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What was that? 😮

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

required
autofocus
value="<?= $this->to ?>"
/>
</div>
</div>
<div class="group-controls">
<input
type="email"
name="to"
id="to"
class="long"
placeholder="[email protected]"
required="required"
autofocus="autofocus"
value="<?= $this->to ?>"
/>
</div>
</div>

<div class="form-group">
<label class="group-name" for="subject">
<?= _t('shareByEmail.share.form.subject') ?>
</label>
<div class="form-group">
<label class="group-name" for="subject">
<?= _t('shareByEmail.share.form.subject') ?>
</label>

<div class="group-controls">
<input
type="text"
name="subject"
id="subject"
class="long"
required
value="<?= $this->subject ?>"
/>
</div>
</div>
<div class="group-controls">
<input
type="text"
name="subject"
id="subject"
class="long"
required="required"
value="<?= $this->subject ?>"
/>
</div>
</div>

<div class="form-group">
<label class="group-name" for="content">
<?= _t('shareByEmail.share.form.content') ?>
</label>
<div class="form-group">
<label class="group-name" for="content">
<?= _t('shareByEmail.share.form.content') ?>
</label>

<div class="group-controls">
<textarea
name="content"
id="content"
required
><?= $this->content ?></textarea>
</div>
</div>
<div class="group-controls">
<textarea
name="content"
id="content"
required="required"
><?= $this->content ?></textarea>
</div>
</div>

<div class="form-group form-actions">
<div class="group-controls">
<button type="submit" class="btn btn-important">
<?= _t('shareByEmail.share.form.send') ?>
</button>
<div class="form-group form-actions">
<div class="group-controls">
<button type="submit" class="btn btn-important">
<?= _t('shareByEmail.share.form.send') ?>
</button>

<a class="btn" href="<?= _url('index', 'index') ?>">
<?= _t('shareByEmail.share.form.cancel') ?>
</a>
</div>
</div>
</form>
<a class="btn" href="<?= _url('index', 'index') ?>">
<?= _t('shareByEmail.share.form.cancel') ?>
</a>
</div>
</div>
</form>
</div>