Skip to content
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

[Backport 2.2-develop] Send email to subscribers only when are new #11317

Merged
merged 3 commits into from
Oct 24, 2017

Conversation

osrecio
Copy link
Member

@osrecio osrecio commented Oct 9, 2017

Only send email/confirmation email of subscription to newsletter only when subscriber is new in newsletter

Description

Check if is necessary send email to a customer that is subscribed to newsletter. If this customer was subscribed previously not necessary send email.

Fixed Issues (if relevant)

  1. Newsletter subscription #5439: Newsletter subscription

Manual testing scenarios

  1. Subscribe an email not subscribed previously (e.g: test@test.com)
  2. this email will receive a confirmation email of subscription
  3. Subscribe the same email (test@test.com)
  4. this email NOT will recieve a confirmation email of subscription

Contribution checklist

  • Pull request has a meaningful description of its purpose
  • All commits are accompanied by meaningful commit messages
  • All new or changed code is covered with unit/integration tests (if applicable)
  • All automated tests passed successfully (all builds on Travis CI are green)

@okorshenko
Copy link
Contributor

Hi @osrecio
Could you please check dev/tests/integration/testsuite/Magento/Newsletter/Model/SubscriberTest.php : testEmailConfirmation

Magento\Newsletter\Model\SubscriberTest::testEmailConfirmation
Error: Call to a member function getBodyHtml() on null

/dev/tests/integration/testsuite/Magento/Newsletter/Model/SubscriberTest.php:36

You can execute it locally or wait for Travis results

@okorshenko
Copy link
Contributor

Also, please check code style

Magento\Test\Php\LiveCodeTest::testCodeStyle
PHP Code Sniffer detected 2 violation(s): 

FILE: ./app/code/Magento/Newsletter/Model/Subscriber.php
----------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
----------------------------------------------------------------------
 449 | ERROR | [x] Expected 1 space after IF keyword; 0 found
(9 more lines...)

Same issues here: #11316

@okorshenko
Copy link
Contributor

Hi @osrecio thank you for fixing code style. But more critical issue is in integration test: dev/tests/integration/testsuite/Magento/Newsletter/Model/SubscriberTest.php:testEmailConfirmation

@osrecio
Copy link
Member Author

osrecio commented Oct 10, 2017

Yes, I know. Working on it. Thanks

@okorshenko okorshenko added bug report Component: Customer Reproduced on 2.1.x The issue has been reproduced on latest 2.1 release labels Oct 12, 2017
@osrecio
Copy link
Member Author

osrecio commented Oct 18, 2017

All tests passed :)

@osrecio osrecio changed the title [Fix:5439] Send email to subscribers only when are new 2.2 [Backport] [Backport 2.2-develop] Send email to subscribers only when are new Oct 20, 2017
@okorshenko okorshenko merged commit 393bace into magento:2.2-develop Oct 24, 2017
okorshenko pushed a commit that referenced this pull request Oct 24, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants