Commit Graph

78 Commits

Author SHA1 Message Date
Jan Lysý
fc03639aff Add using List-Unsubscribe-Post header to PHPMailerMethod
[MAILPOET-5983]
2024-04-08 11:12:59 +02:00
Mike Jolley
435f638011 Apply rules on lib dir 2024-03-21 16:57:59 +01:00
Rodrigo Primo
5646464853 Refactor Mailer::formatSubscriberNameAndEmailAddress() to use Doctrine
[MAILPOET-5758]
2024-01-31 12:44:58 +01:00
David Remer
77e3bfa823 Update link for banned users
[MAILPOET-5825]
2024-01-22 12:24:16 +01:00
Brezo Cordero
6d86cc9983 Improve readability
[MAILPOET-5832]
2024-01-20 13:39:23 +05:00
Brezo Cordero
4a0ed51c8c Reduce API calls to verify sender domain during sending
and call checkAuthorizedEmailAddresses on bulk email sending error.

[MAILPOET-5832]
2024-01-20 13:39:23 +05:00
Brezo Cordero
fb406350a5 Map ERROR_MESSAGE_BULK_EMAIL_FORBIDDEN
Create a soft error to not block sending.

[MAILPOET-5832]
2024-01-20 13:39:23 +05:00
John Oleksowicz
d0e6904d68 Restore <br/> to getCanNotSendError message
MAILPOET-5631
2023-11-02 18:15:55 +01:00
John Oleksowicz
4a4ecc8204 Consistent pending approval message
MAILPOET-5631
2023-11-02 18:15:55 +01:00
Brezo Cordero
3104b61005 Remove data-beacon-article
[MAILPOET-5551]
2023-09-07 14:50:35 +02:00
Rodrigo Primo
75f8af13be Refactor MetaInfo::getNewsletterMetaInfo() to use Doctrine
[MAILPOET-5344]
2023-05-25 06:52:00 -05:00
Rodrigo Primo
54b693b654 Refactor MetaInfo to use Doctrine instead of Paris
[MAILPOET-5344]
2023-05-25 06:52:00 -05:00
Rostislav Wolny
15aeea834f Handle error message for exceeded email limit when limit is not known
[MAILPOET-5191]
2023-05-10 13:05:37 +02:00
Rostislav Wolny
469b9bf85f Remove unnecessary premium key refresh when volume limit error happens
The limit is stored in and read from MSS key state and now we preserve
state data even when the key becomes underprivileged.
We don't need to refresh anything and also the checking underprivileged key
would return 403 and no data about limits.
[MAILPOET-5191]
2023-05-10 13:05:37 +02:00
Rostislav Wolny
db467d8616 Add handling of subscriber limit error to MailPoet error mapper
When the shop blocked access for an API key due subscriber limit it used
to set the error as "Insufficient privileges," and that was in the plugin
interpreted same as "Subscribers limit reached".
The SHOP-1228 changes the error message will be set to "Subscribers limit reached".
This commit updates the error mapper to be able to process the new error message.
It also keeps the old approach for previously blocked keys.
[MAILPOET-5191]
2023-05-10 13:05:37 +02:00
Rostislav Wolny
4995ed93f0 Refactor invalidation of MSS key to non static method
This is the olny staically called method from the service. In this commit I refactored it to non-static so that it works properly with injected services.
[MAILPOET-5191]
2023-05-10 13:05:37 +02:00
Rodrigo Primo
5a85390655 Replace remaining calls to utf8_encode() with mb_convert_encoding()
In the previous commit, I removed all calls to the deprecated
utf8_encode() that seemed safe to remove. In this commit, I'm replacing
the calls to this function that I'm not sure if are same to remove or
not with mb_convert_encoding().

mb_convert_encoding() requires the extension mbstring to be enabled. It
should be enabled on most PHP install but not all. We are already using
mbstring functions in our code base and we provide a polyfill for PHP
installs where the extension is not enabled
(62bb75ed91/mailpoet/prefixer/composer.json (L25)).
So it should be safe to use it.

[MAILPOET-4865]
2023-04-28 10:26:03 +02:00
Sam Najian
ef3c64b85d Adjust use Html2Text from MailPoetVendor namespace
[MAILPOET-5128]
2023-03-15 15:02:32 -03:00
Rostislav Wolny
87e5ea8dfd Add filter for PHPMailer instance into SMTP mailer method
[MAILPOET-5064]
2023-02-23 16:45:39 +01:00
Jan Lysý
579de1cc86 Reduce the count of constants
[MAILPOET-4639]
2023-01-16 13:46:07 +01:00
Jan Lysý
ad831316ab Remove unused constants
[MAILPOET-4639]
2023-01-16 13:46:07 +01:00
Jan Lysý
2e97cb6924 Fix tests after last changes
[MAILPOET-4639]
2023-01-16 13:46:07 +01:00
Jan Lysý
982568445b Extract sending error messages from bridge to strings
The original error is stored under a new key for easier handling an error state.
[MAILPOET-4639]
2023-01-16 13:46:07 +01:00
Rostislav Wolny
0bbdf4b47f Add error log when pausing sending due an error
[MAILPOET-4940]
2023-01-09 20:01:47 +01:00
Rostislav Wolny
e13113e38b Fix condition for pausing sending when confirmation emails fail
[MAILPOET-4736]
2022-12-28 14:25:56 +01:00
Rostislav Wolny
11beebf74d Add MailerLog method for handling transactional emails errors
The new method allows processing sending errors that happen when sending from other places of plugin
then from the Sending Queue worker.
After three failed attempts it pauses the sending and admin user will see an notice.
[MAILPOET-4736]
2022-12-28 14:25:56 +01:00
Jan Jakes
926620e8f8 Ignore strict types rule in all existing files that don't have it
[MAILPOET-2688]
2022-11-29 15:04:09 +01:00
Jan Jakes
c67c58709b Unify spacing of declare statements
[MAILPOET-2688]
2022-11-29 15:04:09 +01:00
David Remer
4832771185 Refactor the captcha system
The current Captcha class has a lot of responsibilities. It renders the captcha
image, can check if a certain captcha type is a Google captcha, if a captcha is
required for a certain email. The SubscriberSubscribeController is not only in
charge of "controlling" the subscription process but also validates, whether a
captcha is correct or not. This architecture made it difficult to extend the
functionality and introduce the audio captcha feature.

Therefore this commit refactors the captcha architecture and tries to seperate
the different concerns into several classes and objects. Validation is now done
by validators.

The CaptchaPhrase now is in charge of keeping the captcha phrase consistent
between the image and the new audio, so that you can renew the captcha and both
captchas are in sync.

[MAILPOET-4514]
2022-11-24 09:20:39 +01:00
Jan Jakes
dee5ff38f5 Fix error when sending a preview email with MSS
With HTTPS and "$oneClickUnsubscribeUrl = false", we were sending "false" instead of an actual URL.

[MAILPOET-4813]
2022-11-15 15:05:03 +01:00
Sam Najian
50b613365f Make sure one-click unsubscribe url won't redirect internally
[MAILPOET-4703]
2022-11-11 09:21:30 +01:00
Sam Najian
8e69299a6a Adjust naming and use wp wrapper I/O of direct usage
[MAILPOET-4702]
2022-11-09 12:36:44 +01:00
Sam Najian
8d6492ac8c Adjust constructor injections of instantiators of MailPoet
[MAILPOET-4702]
2022-11-09 12:36:44 +01:00
Sam Najian
c39ae1fe1f Adjust the unsubscribe key to use the new structure
[MAILPOET-4702]
2022-11-09 12:36:44 +01:00
Rostislav Wolny
e33539c5ca Prevent triggering cron when sending is waiting for retry
[MAILPOET-4686]
2022-10-13 14:21:43 +02:00
Oluwaseun Olorunsola
c1f5ddf96e Improve the DMARC error message
When the DMARC error message is displayed, add the sentence Click here to start the authentication. This will be a link that opens the verify domain dialogue

MAILPOET-4311
2022-09-08 12:51:48 +02:00
Jan Lysý
52795c3972 Add new filters to the SMTP sending method
[MAILPOET-4437]
2022-08-22 13:16:51 +02:00
David Remer
218de96024 Fix WordPress.WP.I18n.MissingTranslatorsComment errors
[MAILPOET-4524]
2022-08-09 13:23:16 +02:00
David Remer
b05e6d414c Remove WP\Functions::__ and other translate functions
Under the new sniffer rules, those functions produce errors and, when those methods
are used, the sniffer can not properly be applied.

[MAILPOET-4524]
2022-08-09 13:23:16 +02:00
Rodrigo Primo
932512b720 Replace Paris models with Doctrine entities in MetaInfoTest
In the process it was necessary to change the signature of the method
\MailPoet\Mailer\MetaInfo::getNewsletterMetaInfo() to accept a
SubscriberEntity instead of a Subscriber model and also change
\MailPoet\Cron\Workers\SendingQueue\SendingQueue::processQueue() as it
calls getNewsletterMetaInfo().

Doing this was straightforward, but changing the test class for
SendingQueue was a bit more involved. In particular, the test
SendingQueueTest::testItEnforcesExecutionLimitsAfterQueueProcessing().

This test is a bit brittle and was creating Subscriber models without
saving them to the database with invalid statuses and sources. Switching
getNewsletterMetaInfo() to use entities, while
SendingQueue::processQueue() still uses models, meant that it was
necessary to save the subscribers to the database. Because of this, it
was not possible anymore to use invalid statuses and sources, and
thus, the test changed a bit.

[MAILPOET-4379]
2022-07-27 08:48:15 +02:00
Sam Najian
f9f9908269 Default metaInfo type to newsletter::type if defined
[MAILPOET-4393]
2022-07-14 12:01:49 +02:00
Rostislav Wolny
61be43fb3c Use original PHPMailer sending instead as a fallback for transactional emails
Instead of using second mailer with a different configuration we just send from the PHPMailer
as it was configured in wp_mail function.
[MAILPOET-4254]
2022-06-21 16:04:09 +02:00
Rostislav Wolny
2d21489c44 Always reset MailerLog error on increment send count
Recently we've stopped incrementing sending counter when site configured to use MSS.
This caused that also code reseting the sending error was skipped.
This commit changes incrementSentCount method so that it always clears error log.
[MAILPOET-4448]
2022-06-20 14:17:54 +02:00
Ján Mikláš
f10596feec Fix typos in translations
[MAILPOET-4447]
2022-06-20 10:17:24 +02:00
Sam Najian
b2e556fd90 Inject WPFunctions to AmazonSES
[MAILPOET-4394]
2022-06-20 09:24:49 +02:00
Jan Lysý
978afcdc1c Fix condition for authentication
[MAILPOET-4398]
2022-06-06 11:16:07 +02:00
Jan Lysý
00fe1eb1c4 Replace transport hook with a new smpt_options
[MAILPOET-4142]
2022-05-23 11:38:32 +02:00
Jan Lysý
0186ddee35 Replace Swift_message with PHPMailer
[MAILPOET-4142]
2022-05-23 11:38:32 +02:00
Jan Lysý
d7582ede37 Move common code into parent class
[MAILPOET-4142]
2022-05-23 11:38:32 +02:00
Jan Lysý
670e6e4cba Replace Swift Mailer for PHPMailer
[MAILPOET-4142]
2022-05-23 11:38:32 +02:00