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

Fix to Email Sending Issue with SparkPost #9006

Merged
merged 1 commit into from Jul 19, 2020
Merged

Conversation

mabumusa1
Copy link
Member

@mabumusa1 mabumusa1 commented Jul 12, 2020

Q A
Branch? 3.0
Bug fix? yes
New feature? no
Deprecations? no
BC breaks? no
Automated tests included? yes
Related user documentation PR URL
Related developer documentation PR URL
Issue(s) addressed #8621

Description:
This issue happen when you use Sparkpost, Swift Mail throws an exception and the emails are not sent.

Steps to re-produce:

  1. Select sparkpost
  2. Send a campaign email or segment email and send
  3. You will get the following error

mautic.ERROR: [MAIL ERROR] content.headers json dictionary value has type 'number' when expecting type 'string' Log data: !! content.headers json dictionary value has type 'number' when expecting type 'string' (code: 0) (send); victorcampuzano@XXXXXXXXXXXXXXX.com {"exception":"[object] (Swift_TransportException(code: 0): content.headers json dictionary value has type 'number' when expecting type 'string'\nLog data:\n!! content.headers json dictionary value has type 'number' when expecting type 'string' (code: 0) at

@codecov
Copy link

codecov bot commented Jul 12, 2020

Codecov Report

Merging #9006 into 3.0 will increase coverage by 0.00%.
The diff coverage is 0.00%.

Impacted file tree graph

@@            Coverage Diff            @@
##                3.0    #9006   +/-   ##
=========================================
  Coverage     35.24%   35.24%           
- Complexity    27900    27907    +7     
=========================================
  Files          1731     1731           
  Lines         96443    96452    +9     
=========================================
+ Hits          33987    33995    +8     
- Misses        62456    62457    +1     
Impacted Files Coverage Δ Complexity Δ
...undle/Swiftmailer/Transport/SparkpostTransport.php 71.85% <0.00%> (ø) 84.00 <0.00> (ø)
app/bundles/PointBundle/Model/PointModel.php 24.26% <0.00%> (ø) 44.00% <0.00%> (+1.00%)
...pp/bundles/EmailBundle/Form/Type/EmailOpenType.php 0.00% <0.00%> (ø) 5.00% <0.00%> (ø%)
...dles/EmailBundle/EventListener/PointSubscriber.php 80.00% <0.00%> (+7.27%) 13.00% <0.00%> (+6.00%)

@mabumusa1
Copy link
Member Author

@dennisameling may you please review this issue, it is blocking a lot of people who use sparkpost

@dennisameling dennisameling added bug Issues or PR's relating to bugs ready-to-test PR's that are ready to test labels Jul 13, 2020
@dennisameling dennisameling added this to the 3.0.2 milestone Jul 13, 2020
@dennisameling dennisameling self-requested a review July 13, 2020 19:13
@dennisameling
Copy link
Member

@mabumusa1 Thanks, will test on Wednesday :)

@kuzmany
Copy link
Member

kuzmany commented Jul 13, 2020

@mabumusa1 Can you add title of this pull requests and description?

@mabumusa1 mabumusa1 changed the title Fix Issue #8621 Fix to Email Sending Issue with SparkPost Jul 14, 2020
@mabumusa1
Copy link
Member Author

@kuzmany changed the title and added description

@dennisameling dennisameling added T2 Medium difficulty to fix (issue) or test (PR) T3 Hard difficulty to fix (issue) or test (PR) and removed T2 Medium difficulty to fix (issue) or test (PR) labels Jul 15, 2020
Copy link
Member

@dennisameling dennisameling left a comment

Choose a reason for hiding this comment

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

Created a Sparkpost account to test this PR. If the 2nd reviewer needs my account to test, please reach out via Mautic Slack.

Can confirm the bug exists:

[2020-07-15 19:18:58] mautic.ERROR: [MAIL ERROR] content.headers json dictionary value has type 'number' when expecting type 'string' (send); <REDACTED> {"exception":"[object] (Swift_TransportException(code: 0): content.headers json dictionary value has type 'number' when expecting type 'string' at /var/www/html/app/bundles/EmailBundle/Swiftmailer/Transport/AbstractTokenArrayTransport.php:300)"} []

After applying this PR, it works as expected. Thanks @mabumusa1! 🚀

@dennisameling dennisameling added pending-test-confirmation PR's that require one test before they can be merged and removed ready-to-test PR's that are ready to test labels Jul 15, 2020
@RCheesley RCheesley linked an issue Jul 17, 2020 that may be closed by this pull request
Copy link
Sponsor Member

@RCheesley RCheesley left a comment

Choose a reason for hiding this comment

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

Confirm the bug before applying the PR:

[2020-07-19 20:51:46] mautic.ERROR: [MAIL ERROR] content.headers json dictionary value has type 'number' when expecting type 'string' (send); HenryLCatalano@einrot.com, ruth@cheesley.me.uk {"exception":"[object] (Swift_TransportException(code: 0): content.headers json dictionary value has type 'number' when expecting type 'string' at /Users/ruth.cheesley/Sites/local.mautic3/mautic/app/bundles/EmailBundle/Swiftmailer/Transport/AbstractTokenArrayTransport.php:300)"} []

Emails successfully sent when the PR is applied! 🎉

@RCheesley RCheesley merged commit 1b2f2f7 into mautic:3.0 Jul 19, 2020
@mabumusa1 mabumusa1 deleted the issue_8621 branch July 24, 2020 06:50
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 pending-test-confirmation PR's that require one test before they can be merged T3 Hard difficulty to fix (issue) or test (PR)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Cant send emails using sparkpost but test emails works fine
4 participants