More or less all the functionality for selectable unsubscription process. Not tested yet!

Sending emails moved completely to controller. It felt strange to have some emails sent from the controller and some of them from the model.
Confirmations refactored to an independent model that can be potentially used also for other actions that need an email confirmation.
This commit is contained in:
Tomas Bures 2017-05-03 15:46:49 -04:00
parent 32e2e61789
commit bd4961366f
13 changed files with 672 additions and 488 deletions

View file

@ -5,8 +5,17 @@ SET @schema_version = '28';
# Add unsubscription mode field to lists
ALTER TABLE `lists` ADD COLUMN `unsubscription_mode` int(11) unsigned DEFAULT 0 NOT NULL AFTER `public_subscribe`;
# Delete all confirmations as we use different structure in "data".
DELETE FROM `confirmations`;
# Change the name of the column to better reflect that confirmations are also used for unsubscription and email address update
# Drop email field as this does not have a clear semantics in change address. Since email is not used to search in the table,
# it can be stored in data
# Create field action to distinguish between different confirmation types (subscribe, unsubscribe, change-address)
ALTER TABLE `confirmations` CHANGE `opt_in_ip` `ip` varchar(100) DEFAULT NULL;
ALTER TABLE `confirmations` DROP `email`;
ALTER TABLE `confirmations` ADD COLUMN `action` varchar(100) NOT NULL AFTER `list`;
# Rename affected forms in custom_forms_data
update custom_forms_data set data_key="mail_confirm_subscription_html" where data_key="mail_confirm_html";