Skip to content

Conversation

@lmeyer1
Copy link
Contributor

@lmeyer1 lmeyer1 commented Nov 4, 2022

Questions Answers
Description? Add fields to the table ps_mailalert_customer_oos, in order for merchant to be able to analyze customer needs and behavior.
Type? improvement
BC breaks? no
Deprecations? no
Fixed ticket? Fixes PrestaShop/PrestaShop#30186. Prerequisite for #28233.
How to test? Email alerts for customers should just work the same way as before.

There are these improvements in the db:

  • when a customer subscribes to an alert, the time is saved to date_add
  • when a notification is sent out, the time is saved to notification_sent and the line is soft-deleted.
  • the notification is soft deleted on customer request or when a product is deleted
  • if the customer requests deletion of his data through gdpr, the email address is anonymized.

@lmeyer1 lmeyer1 closed this Nov 4, 2022
@lmeyer1 lmeyer1 reopened this Nov 4, 2022
@marsaldev marsaldev added this to the 2.4.1 milestone Nov 18, 2022
@marsaldev
Copy link
Contributor

The soft delete is very interesting 👍, let's understand how to manage on legal side tho

@lmeyer1
Copy link
Contributor Author

lmeyer1 commented Nov 18, 2022

The soft delete is very interesting 👍, let's understand how to manage on legal side tho

I missed to delete all customer data. But once this is fixed, there should not remain any legal problem. Don't you think ?

@marsaldev
Copy link
Contributor

Waiting for you @lmeyer1 😉

@Hlavtox Hlavtox modified the milestones: 2.4.1, 2.4.2 Mar 23, 2023
@MatShir MatShir removed the waiting for author Waiting for author label Jun 15, 2023
@jf-viguier
Copy link
Contributor

This PR is blocking 2.4.2 release.

LouisAUTHIE
LouisAUTHIE previously approved these changes Aug 4, 2023
Copy link

@LouisAUTHIE LouisAUTHIE left a comment

Choose a reason for hiding this comment

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

Thanks

@LouisAUTHIE
Copy link

@lmeyer1 can you rebase maybe on the latest version of the dev branch to avoid merge worries ?

@souvrard
Copy link

souvrard commented Aug 9, 2023

For information, the install function has a bug preventing database creation: missing coma at the end of line 139

	`deleted` TINYINT NOT NULL DEFAULT 0,
	`notification_sent` DATETIME NULL DEFAULT NULL <===== MISSING COMA
	PRIMARY KEY  (`id_customer`,`customer_email`,`id_product`,`id_product_attribute`,`id_shop`),
`̀`

@lmeyer1
Copy link
Contributor Author

lmeyer1 commented Aug 11, 2023

@LouisAUTHIE I hope the rebase was successful.
@souvrard Thanks for pointing this out.

@matks matks removed this from the 2.4.2 milestone Sep 27, 2023
@Touxten Touxten closed this Jan 15, 2026
@github-project-automation github-project-automation bot moved this from Ready for review to Closed in PR Dashboard Jan 15, 2026
@Touxten Touxten reopened this Jan 15, 2026
@github-project-automation github-project-automation bot moved this from Closed to Reopened in PR Dashboard Jan 15, 2026
@Touxten Touxten added this to the 3.0.2 milestone Jan 15, 2026
jf-viguier
jf-viguier previously approved these changes Jan 20, 2026

/** @var string Object last modification date */
public $date_upd;

Copy link
Contributor

Choose a reason for hiding this comment

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

notification_sent and deleted are missing I guess

'id_shop' => ['type' => self::TYPE_INT, 'validate' => 'isUnsignedInt', 'required' => true],
'id_lang' => ['type' => self::TYPE_INT, 'validate' => 'isUnsignedInt', 'required' => true],
'date_add' => ['type' => self::TYPE_DATE, 'validate' => 'isDate'],
'date_upd' => ['type' => self::TYPE_DATE, 'validate' => 'isDate'],
Copy link
Contributor

Choose a reason for hiding this comment

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

notification_sent and deleted are missing I guess

function upgrade_module_2_3_4()
{
$result = Db::getInstance()->execute('ALTER TABLE `' . _DB_PREFIX_ . 'mailalert_customer_oos` ADD `date_add` DATETIME NOT NULL, ADD `date_upd` DATETIME NOT NULL;');
$result = $result && Db::getInstance()->execute('ALTER TABLE `' . _DB_PREFIX_ . 'mailalert_customer_oos` ADD `deleted` TINYINT NOT NULL DEFAULT 0, ADD `notification_sent` DATETIME NULL DEFAULT NULL, ADD INDEX (`deleted`)');
Copy link
Contributor

Choose a reason for hiding this comment

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

this two lines could be in one

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: Reopened

Development

Successfully merging this pull request may close these issues.

ps_emailalerts does not save creation time of request for notification

9 participants