feat: complete Newsletter Campaigns Phase 1

- Add default campaign email template to DefaultTemplates.php
- Add toggle settings (campaign_scheduling, subscriber_limit_enabled)
- Add public unsubscribe endpoint with secure token verification
- Update CampaignManager to use NewsletterController unsubscribe URLs
- Add generate_unsubscribe_url() helper for email templates
This commit is contained in:
Dwindi Ramadhana
2025-12-31 21:17:59 +07:00
parent 3d5191aab3
commit d7505252ac
4 changed files with 138 additions and 6 deletions

View File

@@ -75,6 +75,25 @@ class NewsletterSettings {
'placeholder' => __('I agree to receive marketing emails', 'woonoow'),
'default' => __('I agree to receive marketing emails and understand I can unsubscribe at any time.', 'woonoow'),
],
// Campaign Settings
'campaign_scheduling' => [
'type' => 'toggle',
'label' => __('Campaign Scheduling', 'woonoow'),
'description' => __('Enable scheduled campaigns. When on, you can schedule campaigns to be sent at a specific date and time.', 'woonoow'),
'default' => false,
],
'subscriber_limit_enabled' => [
'type' => 'toggle',
'label' => __('Subscriber Limit', 'woonoow'),
'description' => __('Limit subscribers to 1000. When disabled, a custom database table will be created for unlimited subscribers.', 'woonoow'),
'default' => true,
],
'subscriber_limit' => [
'type' => 'number',
'label' => __('Max Subscribers', 'woonoow'),
'description' => __('Maximum number of subscribers when limit is enabled (default: 1000)', 'woonoow'),
'default' => 1000,
],
];
return $schemas;