Installing & Configuring Sparkpost for Mautic 5.1

Your software
My Mautic version is: 5.1
My PHP version is: 8.2
My Database type and version is: 10.6.18-MariaDB

Could someone please guide me on how to install Sparkpost plugin for Mautic 5.1? We have used Mautic 4.x before and it worked flawlessley. Unfortunately, native support for Sparkpost was removed from Mautic 5.1 and now we have a problem. I cannot really find any documentation how to do this other than GitHub - ts-navghane/sparkpost-plugin: Sparkpost Mailer Plugin for Mautic
However, I am not a developer and need some guidance on how to install this.
Do I just need to run the command composer require ts-navghane/sparkpost-plugin in the console or what else? Thank you.

These errors are showing in the log:

Steps I have tried to fix the problem:

So, I have finally been able to install Sparkpost in console using this command:

composer require ts-navghane/sparkpost-plugin

When I go to the Plugins in Mautic, I get this:


Is this correct? Is there anything I would have to configure here on this screen?

As of now, only 1 email is sent each time as per the warning. This is why I MUST get Sparkpost to work on our Mautic installation:


Any help is greatly appreciated. Thank you very much.

In addition to the above, I have also set the following. Again, only 1-2 emails are sent, even though Mautic said that 20 emails were sent. What am I missing?

Thats interesting. Is it even configurable to have one mail per request in an API call?

@gathh its important to check the features that the sparkpost plugin provides. If you can sent through this plugin, the limitation may not be valid. Did you set it up as described in the readme: GitHub - ts-navghane/sparkpost-plugin: Sparkpost Mailer Plugin for Mautic ?

Pay attention to the Mailer DSN, it might be different, when using the plugin versus core.

@dirk_s Thank you for your inputs. I am not sure if it even configurable to have one mail per request in an API call. I just follow what was written in the Mautic 5.0 documentation on this: Mautic configuration settings — Mautic Documentation 0.1 documentation

You mentioned to check the features that the sparkpost plugin provides. There is not a whole lot to check/see. The readme is ultra limited unfortunately.
Yes, I followed the readme file and set it up as such.

I saw others using doctrine when sending via Sparkpost API, so I am using doctrine also. Should I try something else?

Email sending via Sparkpost API works. All campaigns (ongoing emails that are sent in the background) are sending fine and email broadcasts send fine too, but only send to 1-2 emails instead of all 200 emails (for example) as proclaimed by Mautic’s sent report.

I am actually SO close to getting this all running smoothly, but yet have to overcome this final step of why only 1-2 emails are sent instead of all.

We have now reverted back to Mautic v4.4.10 as we require batch sending. Sending one-by-one is out of the question for us with a DB of over 200k. Its a shame that batch sending is not supported/explained well in Mautic 5.x. Batch sending in my opinion is one of the fundamental features of any mass-mail software.

Hi @gathh,
indeed… loooks like core is very much limited. Thats why people started to create plugins e.g. for Amazon AWS. Not sure about the state of Sparkpost Plugins yet, but will need to investigate for a client anyways soon. I keep you posted, once I find out about it.

Related question(s) I hope someone can help with. I HAD Mautic working with Sparkpost.
Now I successfully upgraded self-hosted Mautic from 4.X to 5.X only to discover (after-the-fact) the Mailer changes and that it breaks my setup.

Do I NEED Composer to use this plugin?

FYI, I did the Mautic upgrade using Command line Console (I used to use the GUI, but switched several upgrades ago after it was “recommended”). I DO NOT HAVE (yet?) Composer setup, and honestly I’m basically a bit scared to do the change to Composer (both the change itself and then using Composer due to not knowing Composer yet).

I even considered changing from Sparkpost to Mailjet, or Brevo, or…? thinking I might find an “easier” path (after reading about the existing the Symfony Mailer library support), but after looking a bit… maybe not. They all seem to provide features I don;t need (I will use Mautic for these purposes), I mainly want transactional and Marketing email deliverability). FYI I also use PrestaShop, and it’s using Sparkpost no-problem.

So back to getting Sparkpost working…

Is this Mautic Plugin (for Sparkpost integration) my best and easiest route?
Can I install in my Mautic WITHOUT changing to composer?
Is it really time for me to change to Composer (and should I either not be afraid or just get over it… maybe my fear is all unfounded).

Expert feedback / Suggestions are appreciated.

Never mind… with some awesome help from my hosting companies support, I’ve changed to Composer setup. I’ll start a new thread

Hi @gathh, I have the same problem, only one mail was sent. I found the problem and the nasty fix.

See this issue Sending emails to segments using SparkPost with bach > 1 sends just first email from the batch · Issue #13548 · mautic/mautic · GitHub

If you apply this fix API Email Transport fix by escopecz · Pull Request #13998 · mautic/mautic · GitHub works well, all mails are sent, but warning because escopecz says that this will enable a nasty issue in the one-click unsubscribe header.

Maybe it helps you in something.