Commit Graph

38 Commits

Author SHA1 Message Date
Rodrigo Primo
d39d09dd72 Remove calls to Subscriber::setError() from ConfirmationEmailMailer
This commit is part of a task to replace Paris with Doctrine in the
class ConfirmationEmailMailer. Specifically, it removes two calls to
Subscriber::setError() inside ConfirmationEmailMailer::sendConfirmationEmail().

setError() was used to define an error message that was used only in one
of the instances where sendConfirmationEmail() is called
(API::subscribeToLists()). setError() was replaced with code that throws
an exception when there is an error. Thus it was necessary to change all
the places where ConfirmationEmailMailer::sendConfirmationEmail() is
called to handle the exception.

In some cases, there are some oddities as sendConfirmationEmail() can
return false or throw an exception in case of an error and calling code
must account for both. I decided to settle with this approach as
refactoring the rest of this method to use exceptions instead of
returning false seemed outside of the scope of this task.

[MAILPOET-3815]
2021-12-13 16:03:07 +01:00
Rodrigo Primo
6c05b3eaf0 Pass SubscriberEntity to sendConfirmationEmail() and sendConfirmationEmailOnce()
This commit changes the methods sendConfirmationEmail() and
sendConfirmationEmailOnce() to accept as the first parameter an instance
of SubscriberEntity instead of the old model Subscriber. It also updates
all the places where those two methods are called.

[MAILPOET-3815]
2021-12-13 16:03:07 +01:00
Rodrigo Primo
1dbedea50f Refactor MetaInfo::getConfirmationMetaInfo() to use Doctrine
This method is used only inside
ConfirmationEmailMailer::sendConfirmationEmail(). So I figured it was
best to refactor it as well to use SubscriberEntity instead of the old
Subscriber model as part of the task to do the same for the
ConfirmationEmailMailer class. I opted for this approach since it was a
straightforward change.

[MAILPOET-3815]
2021-12-13 16:03:07 +01:00
Ján Mikláš
0daaac8abf Ignore Html2Text::convert errors in confirmation email
[MAILPOET-3756]
2021-08-23 11:33:57 +02:00
Jan Lysý
7d49d39efc Use Doctrine entities in SubscriptionUrlFactory
[MAILPOET-3269]
2021-06-14 10:12:34 +02:00
Rostislav Wolny
c6bb38cc69 Add method for sending confirmation email with duplicates check
[MAILPOET-2876]
2020-09-09 13:09:06 +02:00
Jan Jakeš
b39dac75d6 Autofix number of newlines between methods
[MAILPOET-2715]
2020-02-19 19:12:53 +00:00
Pavel Dohnal
4c5155132a Send a confirmation email when a user is added to a website
[MAILPOET-2567]
2020-01-27 09:26:15 +00:00
Jan Jakeš
8c848cfa28 Convert property names to camel case
[MAILPOET-1796]
2020-01-14 15:22:42 +01:00
Jan Jakeš
54549ff037 Convert variable names to camel case
[MAILPOET-1796]
2020-01-14 15:22:42 +01:00
Amine Ben hammou
43df66d162 Add public keyword to methods
[MAILPOET-2413]
2019-12-26 18:09:45 +03:00
Jan Jakeš
8f029d8308 Remove unneeded non-DI fallbacks
[MAILPOET-2515]
2019-11-14 10:02:28 +00:00
Jan Jakeš
d970dda637 Replace "new SettingsController()" with fetch from DI container
[MAILPOET-2436]
2019-11-06 16:32:32 +00:00
Rostislav Wolny
4d3a005b20 Inject LinkTokens dependency to SubscriptionUrlFactory using DI
[MAILPOET-2381]
2019-09-25 10:29:20 +01:00
Rostislav Wolny
7dba4d900c Rename Subscription\Url to Subscription\SubscriptionUrlFactory
[MAILPOET-2381]
2019-09-25 10:29:20 +01:00
Rostislav Wolny
653dbe5783 Remove aspect mock from Confirmation mailer test
[MAILPOET-2381]
2019-09-25 10:29:20 +01:00
Rostislav Wolny
3c4b60ede9 Refactor getConfirmationUrl to instance method
[MAILPOET-2381]
2019-09-25 10:29:20 +01:00
Amine Ben hammou
eebe6e828f Add meta when sending confirmation emails
[MAILPOET-2333]
2019-09-22 10:58:17 +02:00
Amine Ben hammou
4c57e59c74 Remove uneeded variables
[MAILPOET-2328]
2019-09-12 15:45:34 +02:00
Amine Ben hammou
674d8f9926 Use sender and reply-to settings for confirmation emails
[MAILPOET-2328]
2019-09-12 15:45:34 +02:00
Pavel Dohnal
ba119846f2 Prevent blocking confirmation emails for admin
[MAILPOET-2159]
2019-08-12 12:23:59 +01:00
Pavel Dohnal
8739646a6a Move mailer configuration to init method
[MAILPOET-2146]
2019-07-24 13:54:49 -04:00
wxa
7f40e5b512 Clean up unused imports [MAILPOET-2208] 2019-07-19 08:54:50 -04:00
Pavel Dohnal
62a7d17582 Prevent showing mailer errors to subscribers
[MAILPOET-2120]
2019-06-26 11:21:12 -04:00
Rostislav Wolny
f86c0c9612 Refactor authorized emails validation from Bridge to Controller
[MAILPOET-2022]
2019-06-03 12:54:24 -04:00
Rostislav Wolny
ced9c549f6 Prevent sending confirmation emails when address is unauthorized
[MAILPOET-1987]
2019-05-21 09:58:29 -04:00
Rostislav Wolny
aa105effc7 Fix silent errors in confirmation mailer
[MAILPOET-1987]
2019-05-21 09:58:29 -04:00
Pavel Dohnal
5d64ec168d Add rule for concatenation operator spacing
[MAILPOET-2090]
2019-05-20 10:18:45 -04:00
Pavel Dohnal
5da7110eb6 Use short array syntax
[MAILPOET-2090]
2019-05-20 10:18:45 -04:00
Pavel Dohnal
e8a2b970df Send text version of confirmation email
[[MAILPOET-1966]
2019-04-10 06:36:47 -04:00
Pavel Dohnal
21766421d5 Upgrade PHPStan level to 4
I had to add some ignore errors until phpstan/phpstan#1482 is resolved

[MAILPOET-1915]
2019-03-21 14:02:59 -04:00
Ján Mikláš
3ee58aea10 Add space between if and ‘(‘
[MAILPOET-1791]
2019-02-13 08:26:27 -05:00
Ján Mikláš
9e9561e576 Add space between catch and ‘(‘
[MAILPOET-1791]
2019-02-13 08:26:27 -05:00
Rostislav Wolny
90d369a721 Fix fatal error with confirmation email sending thru MP API
[MAILPOET-1801]
2019-02-11 11:14:35 -05:00
Rostislav Wolny
ce7ad292b8 Refactor MailPoet\Subscribers, Subscription to use new settings
[MAILPOET-1757]
2019-01-31 15:57:58 +01:00
Ján Mikláš
b663d9761e Encapsulate is_user_logged_in function 2019-01-30 13:59:49 +01:00
Ján Mikláš
8e51a56426 Limit number of confirmation emails sent to one email
MAILPOET-1734
2019-01-30 13:59:49 +01:00
Pavel Dohnal
654dd1e8d0 Rename Send classes
[MAILPOET-1522]
2018-10-15 13:06:19 +02:00