in2code-de / luxletter

Newsletter system for TYPO3
https://www.in2code.de/agentur/typo3-extensions/luxletter/
22 stars 25 forks source link

{"exception":"Could not build a valid URL to unsubscribe page to pid10 in site \"mysitename\""} #212

Closed EnzephaloN closed 5 months ago

EnzephaloN commented 6 months ago

Using luxletter 24.0.2 in TYPO3 12.4.11 (Updated to 25.0.2 - same problem)

Added a newsletter, send to queue. Running send.

Found in log-table:

{"exception":"Could not build a valid URL to unsubscribe page to pid10 in site \"mysitename\""}

TestEmail was send successfully. But none of the queued mails can be send.

Page10 has the unsubscribe2 Plugin

einpraegsam commented 6 months ago

Hi, can you please test with version 25.0.3 and give me feedback - maybe this will help.

EnzephaloN commented 6 months ago

Hello

Sorry, but 25.0.3 does not fix this problem. Newsletter stuck, cause of "Could not build a valid URL to unsubscribe page to pid10 in site "mysitename"" error in log...

einpraegsam commented 6 months ago

The error is thrown here https://github.com/in2code-de/luxletter/blob/develop/Classes/Domain/Service/UnsubscribeUrlService.php#L62 - any chance to debug the exception after line 74?

EnzephaloN commented 5 months ago

I did the following in UnsubscribeService I added those lines:

[...]
} catch (Throwable $exception) {
error_log("U: ".debug($this->user->getUid()));
error_log("N: ".debug($this->newsletter->getUid()));
error_log("H: ".debug($this->user->getUnsubscribeHash()));
            throw new MisconfigurationException(
[...]

The output on console was:

73
8

This means, $this->user-getUid() returns correct 73 and $this->newsletter->getUid() returns correct 8. But $thi-s>user->getUnsubscribeHash() is empty!

einpraegsam commented 5 months ago

Thx, that helps a bit. Pls check if fe_users.crdate is set for the user that wants to unsubscribe.

EnzephaloN commented 5 months ago

Hello

Thank you for your great work and this great extension. It's clear now, that I have to update my users. Because I've imported them into DB, there is no crdate set.

Maybe you can add this to a "troubleshoot"-documentation...

einpraegsam commented 5 months ago

I will spend some time to make the errormessage better - thx for your feedback