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

Fixed fetching messages for campaign replies #6376

Merged
merged 1 commit into from Sep 24, 2018

Conversation

alanhartless
Copy link
Contributor

Please be sure you are submitting this against the staging branch.

Q A
Bug fix? Y
New feature?
Automated tests included?
Related user documentation PR URL
Related developer documentation PR URL
Issues addressed (#s or URLs) #5793
BC breaks?
Deprecations?

Description:

The first time messages were fetched for campaign replies, the imap search "UNSEEN" was used. But subsequent calls used "UID n:*" where n is the UID of the last message processed. Turns out, PHP's implementation of imap_search does not support that criteria. This PR fixes this by using imap_fetch_overview for the UID criteria.

Steps to reproduce the bug:

  1. Go to Mautic's Configuration -> Email Settings and setup an IMAP account for Campaign Replies under Monitored Inboxes
  2. Create a campaign that sends an email with a replies to email decision attached. Add some action to the green anchor (tag, points, whatever).
  3. Add a contact to the campaign
  4. Reply to the email received from the campaign; be sure to send it to the email address configured as the monitored inbox and leave the body intact
  5. If testing against a self hosted install, run the command php app/console mautic:emails:fetch. If testing in the cloud, jobs are ran every 2 minutes
  6. The campaign decision is never acknowledged

Steps to test this PR:

  1. Repeat and the campaign decision will be acknowledged

Copy link
Contributor

@LevryKurniawan LevryKurniawan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's perfect!

@luizeof
Copy link
Member

luizeof commented Aug 15, 2018

@alanhartless Tested and it Works Perfectly with Gmail on 2.14.0

@Lalilu
Copy link

Lalilu commented Aug 22, 2018

I've overwritten the two files of the fix (https://github.com/mautic/mautic/pull/6376/files/c124868b322b2f9bbc875d59376e8823d313c3ac#diff-917b16827cc7ddce112292c90eac2bd9) on my v2.14.0 instance. It didn't help. Still doesn't work.

CronJob log with v2.14.0:
0 emails processed for {myserver.com:993/imap/ssl}INBOX with a criteria of UID 2:*

With overwritten files:
0 emails processed for {myserver.com:993/imap/ssl}INBOX with a criteria of UID 3:1000000003

Did I do it right to test it?

@npracht npracht modified the milestones: 2.15.0, 2.14.2 Sep 5, 2018
@kuzmany kuzmany self-requested a review September 10, 2018 10:02
Copy link
Member

@kuzmany kuzmany left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested. Works for me.
4 approved reviews. We should merge it.

@kuzmany kuzmany added ready-to-commit PR's with 2 successful tests, 1 approval, automated tests and docs and is ready to be merged and removed ready-to-test PR's that are ready to test labels Sep 10, 2018
@kuzmany
Copy link
Member

kuzmany commented Sep 10, 2018

Any native speaker, please review our docs mautic/documentation#291

@papazetis
Copy link

I am using mailjet (i have tried amazon ses as well) as send service and gmail for inbox and it never worked.

@escopecz escopecz merged commit e908e87 into mautic:staging Sep 24, 2018
@escopecz escopecz removed the ready-to-commit PR's with 2 successful tests, 1 approval, automated tests and docs and is ready to be merged label Sep 24, 2018
@escopecz escopecz added this to Merged in Testing 2.14.2 Oct 2, 2018
@alanhartless alanhartless deleted the bug.campaign-replyto-fix branch November 15, 2018 20:36
@RehanNischal
Copy link

Is it solved yet??

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Issues or PR's relating to bugs
Projects
No open projects
Testing 2.14.2
  
Merged
Development

Successfully merging this pull request may close these issues.

None yet

10 participants