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

Allow hiding "Keep formatting" in "dont_override" config #9704

Closed
wants to merge 11 commits into from
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
- Add possibility to change ATTR_EMULATE_PREPARES via config file (#9213)
- Use draft settings (like DSN) on "Edit as new" (#9349)
- Use new HTML5 parser available on PHP >= 8.4
- Allow hiding the "Keep formatting" option (via `dont_override`) when composing an email (#9704)
- Installer: Show NOT OK if none of the database extensions is installed (#9594, #9604)
- Mailvelope: Add a button to enable the extension for webmail domain (#9498)
- OAuth: Add support for SMTP without authentication (#9183)
Expand Down
7 changes: 6 additions & 1 deletion program/actions/mail/send.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,11 @@ public function run($args = [])

$saveonly = !empty($_GET['_saveonly']);
$savedraft = !empty($_POST['_draft']) && !$saveonly;
if (in_array('keep_formatting', $rcmail->config->get('dont_override', []), true)) {
$keepformatting = !empty($rcmail->config->get('keep_formatting', false));
} else {
$keepformatting = !empty($_POST['_keepformatting']);
}
$SENDMAIL = new rcmail_sendmail($COMPOSE, [
'sendmail' => true,
'saveonly' => $saveonly,
Expand All @@ -55,7 +60,7 @@ public function run($args = [])
call_user_func_array([$rcmail->output, 'show_message'], $args);
$rcmail->output->send('iframe');
},
'keepformatting' => !empty($_POST['_keepformatting']),
'keepformatting' => $keepformatting,
]);

// Collect input for message headers
Expand Down
2 changes: 2 additions & 0 deletions skins/elastic/templates/compose.html
Original file line number Diff line number Diff line change
Expand Up @@ -46,12 +46,14 @@ <h2 id="aria-label-composeoptions" class="voice"><roundcube:label name="arialabe
</div>
</div>
<roundcube:endif />
<roundcube:if condition="!in_array('keep_formatting', (array)config:dont_override)" />
<div class="form-group row form-check">
<label for="compose-keep-formatting" class="col-form-label col-6"><roundcube:label name="keepformatting" /></label>
<div class="col-6 form-check">
<roundcube:object name="keepFormattingCheckBox" id="compose-keep-formatting" noform="true" tabindex="2" class="form-check-input" />
</div>
</div>
<roundcube:endif />
<div class="form-group row">
<label for="compose-priority" class="col-form-label col-6"><roundcube:label name="priority" /></label>
<div class="col-6">
Expand Down