Skip to content
Snippets Groups Projects
Commit 71cdd8fb authored by Michael McAndrew's avatar Michael McAndrew
Browse files

Add setting to disable Smarty in scheduled reminders #4100

parent 853f8801
Branches
Tags
No related merge requests found
......@@ -35,6 +35,7 @@ class CRM_Admin_Form_Preferences_Mailing extends CRM_Admin_Form_Preferences {
'auto_recipient_rebuild' => CRM_Core_BAO_Setting::MAILING_PREFERENCES_NAME,
'url_tracking_default' => CRM_Core_BAO_Setting::MAILING_PREFERENCES_NAME,
'open_tracking_default' => CRM_Core_BAO_Setting::MAILING_PREFERENCES_NAME,
'scheduled_reminder_smarty' => CRM_Core_BAO_Setting::MAILING_PREFERENCES_NAME,
];
public function postProcess() {
......
......@@ -631,7 +631,7 @@ FROM civicrm_action_schedule cas
'controller' => __CLASS__,
'actionSchedule' => $schedule,
'actionMapping' => $mapping,
'smarty' => TRUE,
'smarty' => Civi::settings()->get('scheduled_reminder_smarty'),
'schema' => ['contactId'],
]);
$tp->addMessage('body_text', $schedule->body_text, 'text/plain');
......
......@@ -29,6 +29,18 @@ class CRM_Upgrade_Incremental_php_FiveSixty extends CRM_Upgrade_Incremental_Base
*/
public function upgrade_5_60_alpha1($rev): void {
$this->addTask(ts('Upgrade DB to %1: SQL', [1 => $rev]), 'runSql', $rev);
$this->addTask('Add scheduled_reminder_smarty setting', 'addScheduledReminderSmartySetting');
}
public function setPostUpgradeMessage(&$postUpgradeMessage, $rev): void {
if ($rev === '5.60.alpha1') {
$postUpgradeMessage .= '<p>' . ts('You can now choose whether to use Smarty in Scheduled Reminders at <em>Administer >> CiviMail >> CiviMail Component Settings</em>. The setting is disabled by default on new installations but we have enabled it during this upgrade to preserve the existing behavior. More information <a %1>in this lab ticket</a>.', [1 => 'href="https://lab.civicrm.org/dev/core/-/issues/4100" target="_blank"']) . '<p>';
}
}
public static function addScheduledReminderSmartySetting(): bool {
Civi::settings()->set('scheduled_reminder_smarty', TRUE);
return TRUE;
}
}
......@@ -393,4 +393,18 @@ return [
'description' => ts('The frequency that CiviMail updates its sent mail database.'),
'help_text' => NULL,
],
'scheduled_reminder_smarty' => [
'group_name' => 'Mailing Preferences',
'group' => 'mailing',
'name' => 'scheduled_reminder_smarty',
'type' => 'Boolean',
'html_type' => 'checkbox',
'default' => 0,
'title' => ts('Use Smarty in scheduled reminders'),
'add' => '5.60',
'is_domain' => 1,
'is_contact' => 0,
'description' => ts('Controls whether scheduled reminders will attempt to process smarty tokens.'),
'help_text' => NULL,
],
];
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment