New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
refactoring & Test case for send email to dnd contact #12654
refactoring & Test case for send email to dnd contact #12654
Conversation
…t' into test_case_for_send_email_to_dnd_contact
Codecov Report
@@ Coverage Diff @@
## 5.x #12654 +/- ##
=========================================
Coverage 58.45% 58.45%
Complexity 33597 33597
=========================================
Files 2183 2183
Lines 101716 101716
=========================================
+ Hits 59454 59455 +1
+ Misses 42262 42261 -1
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you @dadarya0
A few nitpicks with the tests.
- Instead of having a test with a foreach to test all the emails, we should use a data provider.
- Please don't add phpstan ignore lines unless its the only reasonable solution. I am guessing its to hide a type error? If so use
assert
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you @dadarya0
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Works well as before
- an individual email - no 'List-Unsubscribe',
- an email via API - no 'List-Unsubscribe',
- a transactional email by campaign - no 'List-Unsubscribe',
- a marketing email by campaign - 'List-Unsubscribe'.
Code looks good 👍, thanks.
Maybe a couple of nuances.
If you agree, all hard-coded "transactional" types can be replaced with a constant, e.g. $mailer->setEmailType('transactional')
> $mailer->setEmailType(MailHelper::EMAIL_TYPE_TRANSACTIONAL)
.
If you agree, you can add the MailHelper::EMAIL_TYPE_MARKETING
constant to make the way similar.
@dadarya0 please take a look at the suggestions from @volha-pivavarchyk in the code review above? |
Suggestions Implemented in 39ef1f4 |
Suggestions Implemented in 39ef1f4 |
Description:
Refactoring & Test case for send email to dnd contact which was implemented in https://github.com/mautic/mautic/pull/11787/files
Steps to test this PR: