Commit Graph

37 Commits

Author SHA1 Message Date
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
Jan Lysý
5ee32e5f30 Add abstract parent for PHPMail method
For better reusability and prevention of duplicated code
[MAILPOET-4142]
2022-05-23 11:38:32 +02:00
Jan Lysý
1dd2c82634 Load PHPMailer
We don't support old loading for WordPress 5.5 and lower
[MAILPOET-4142]
2022-05-23 11:38:32 +02:00
Jan Lysý
32c27b91c1 Add handling for more 5xx errors from the bridge
[MAILPOET-4209]
2022-05-11 09:13:09 +02:00
Rostislav Wolny
789385b0c4 Refactor mailerInstance property to mailerMethod
Naming mailerInstance was confusing since
it is not instance of Mailer class but instance of MailerMethod.
[MAILPOET-4115]
2022-04-11 16:54:38 +02:00
Rostislav Wolny
bc6026ca77 Add typehints to MailerMethod interface
[MAILPOET-4115]
2022-04-11 16:54:38 +02:00
Rostislav Wolny
6240debc10 Declare strict types in newly added MailerRelated classes
[MAILPOET-4115]
2022-04-11 16:54:38 +02:00
Rostislav Wolny
8970f00bf3 Inject MailerMethod instance through constructor in Mailer
[MAILPOET-4115]
2022-04-11 16:54:38 +02:00
Rostislav Wolny
2440ed13d9 Remove factory functionality from Mailer
[MAILPOET-4115]
2022-04-11 16:54:38 +02:00
Rostislav Wolny
36edab34e6 Move logic for return path fallback address from method classes to factory
[MAILPOET-4115]
2022-04-11 16:54:38 +02:00
Rostislav Wolny
d4a8315933 Use mailerFactory in SendingQueue Mailer task
[MAILPOET-4115]
2022-04-11 16:54:38 +02:00
Rostislav Wolny
904b6dd34c Refactor WordPress mailer to use MailerFactory
[MAILPOET-4115]
2022-04-11 16:54:38 +02:00
Rostislav Wolny
455d22631e Add caching of default mailer instance in MailerFactory
[MAILPOET-4115]
2022-04-11 16:54:38 +02:00
Rostislav Wolny
68cb5c4f79 Inject MailerFactory instead of mailer
We can't create mailer directly in DI container using the factory because it may fail in case
the plugin is not configured properly and prevent plugin from start.

The Mailer was previously injected because it contains lazy initialization.
The lazy initialization in the singleton Mailer service was dangerous,
because when used with some custom parameters it could cause that all services
that inject the Mailer from DI would use the custom config instead the default.
[MAILPOET-4115]
2022-04-11 16:54:38 +02:00
Rostislav Wolny
51e0426e81 Add MailerFactory service
In this commit I copied and slightly modified functionality used
for creating Mailer instance based on config from the Mailer to an extra class.

The functionality still remains also in Mailer and will be removed later.
I also created test based on the original test for Mailer and added test case
testing it creates specific MailerMethods.
[MAILPOET-4115]
2022-04-11 16:54:38 +02:00
Rostislav Wolny
b10c30a7b1 Add basic interface for MailerMethod
[MAILPOET-4115]
2022-04-11 16:54:38 +02:00
Sam Najian
8f377d9308 Make default value for $linkTag of replaceLinkTags explicit
[MAILPOET-3992]
2022-04-11 15:30:29 +02:00
Sam Najian
9a34c16ea5 Add separate message for pending approval error message
[MAILPOET-3992]
2022-04-11 15:30:29 +02:00
Sam Najian
aed41ef00d Prepare code for more messages
[MAILPOET-3992]
2022-04-11 15:30:29 +02:00
Jan Lysý
ed87d1cace Fix format for List-Unsubscribe header
[MAILPOET-4235]
2022-04-11 09:22:22 +02:00
David Remer
ec7fe4161f Do not increment counter when sending method is MSS
[MAILPOET-4122]
2022-03-21 10:17:37 +01:00
David Remer
c9f7e85eaa Fix MailerLog data on System Status page
[MAILPOET-4122]
2022-03-21 10:17:37 +01:00
David Remer
ac52f2af99 Introduce phpstan-type for MailerLog data
[MAILPOET-4122]
2022-03-21 10:17:37 +01:00
David Remer
53da8bf999 Change data model to calculate sending limit reached
Before this commit, we used to calculate whether the sending limit was reached
by simply counting, how many emails where sent and when we did send them the
last time. In case the last time we did send was before the sending frequency,
and we reached the limit we would reset the calculation.

This led to the following problem:

In case we had e.g. one email send at an outdated timestamp, we would first fill
the outdated timestamp and once we reached the limit, we would reset the counter
and start with the current timestamp. So it followed, we would send more emails
than the limit would allow for.

[MAILPOET-4122]
2022-03-21 10:17:37 +01:00
Jan Lysý
35c18063e8 Add refreshing premium state
We need to refresh premium state because it contains
count of sent emails and email volume limit.
[MAILPOET-4047]
2022-03-01 10:58:31 +01:00
Jan Lysý
69769697ab Add handling new type of error for email volume limit
[MAILPOET-4047]
2022-03-01 10:58:31 +01:00
Jan Lysý
f527a4ae2b Remove prefixing translation function in MailPoetMapper
[MAILPOET-4047]
2022-03-01 10:58:31 +01:00
Oluwaseun Olorunsola
1c7a7549bd Add new Amazon SES locations
[MAILPOET-4041]
2022-01-19 16:15:25 +01:00
Jan Jakes
9f790efbf0 Move plugin files to a subfolder
[MAILPOET-3988]
2022-01-18 15:30:22 +01:00