# Postmark Plugin

**URL:** <https://forum.mautic.org/t/postmark-plugin/31719>\
**Category:** Development\
**Tags:** mautic-5\
**Created:** [April 17, 2024, 4:52am UTC](https://forum.mautic.org/t/postmark-plugin/31719 "2024-04-17T04:52:10Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![econcoder](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/econcoder/32/11785_2.png) [@econcoder](https://forum.mautic.org/u/econcoder)\
**Post date:** [April 17, 2024, 4:52am UTC](https://forum.mautic.org/t/postmark-plugin/31719/1 "2024-04-17T04:52:10Z")

</div>

I’m a developer who hasn’t written PHP in over a decade, so please bear with me. I’m attempting to write a Postmark plugin for Mautic 5 based on the [sparkpost-plugin](https://github.com/ts-navghane/sparkpost-plugin) and the [postmark-mailer](https://github.com/symfony/postmark-mailer/), but I’ve got a few questions:

- Is it reasonable to use the postmark-mailer and then write the plugin just for the callbacks?
- Is it possible, on the Mautic side, to send in batches? I’m worried about how much time it would take to send 50k API requests at \>= 350ms each.
- Is there a reference for how to implement batch sending of emails? It looks like the sparkpost plugin is sending one at a time.
- Is there a plan to update the documentation for v5? The [email documentation](https://devdocs.mautic.org/en/latest/components/emails.html#email-transports) looks like it is v4 since it references SwiftMailer.

Thank you!

---

<div class="post-metadata">

**Author:** ![mzagmajster](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/mzagmajster/32/687_2.png) [@mzagmajster](https://forum.mautic.org/u/mzagmajster)\
**Post date:** [April 17, 2024, 6:56pm UTC](https://forum.mautic.org/t/postmark-plugin/31719/2 "2024-04-17T18:56:34Z")

</div>

Here is the sparkpost integration for mautic, maybe this helps: [GitHub - ts-navghane/sparkpost-plugin: Sparkpost Mailer Plugin for Mautic](https://github.com/ts-navghane/sparkpost-plugin)

---

<div class="post-metadata">

**Author:** ![econcoder](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/econcoder/32/11785_2.png) [@econcoder](https://forum.mautic.org/u/econcoder)\
**Post date:** [April 17, 2024, 8:37pm UTC](https://forum.mautic.org/t/postmark-plugin/31719/3 "2024-04-17T20:37:56Z")

</div>

Thank you for your reply, but I linked that repository in my OP as a reference that I’m already using.

---

<div class="post-metadata">

**Author:** ![mzagmajster](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/mzagmajster/32/687_2.png) [@mzagmajster](https://forum.mautic.org/u/mzagmajster)\
**Post date:** [April 17, 2024, 9:34pm UTC](https://forum.mautic.org/t/postmark-plugin/31719/4 "2024-04-17T21:34:37Z")

</div>

Hi, I was a bit too quick on this one I guess, here are my answers to your questions:

> [@econcoder](#):
>
> - Is it reasonable to use the postmark-mailer and then write the plugin just for the callbacks?

In theory yes, but in my experiance its easier to just take postmark mailer transport from symfony and put it in Mautic plugin so that you can modify and fine tune transport class as well. One example of why would you want that is so that you implement batch sending (symfony mailer does not support that).

> [@econcoder](#):
>
> - Is it possible, on the Mautic side, to send in batches? I’m worried about how much time it would take to send 50k API requests at \>= 350ms each.

Assuming there is an api endpoint that allows you to send in batches you can do that in Mautic.

> [@econcoder](#):
>
> - Is there a reference for how to implement batch sending of emails? It looks like the sparkpost plugin is sending one at a time.

No that I am aware of, but DuckDuckGo is the best source for such questions.

> [@econcoder](#):
>
> - Is there a plan to update the documentation for v5? The [email documentation](https://devdocs.mautic.org/en/latest/components/emails.html#email-transports) looks like it is v4 since it references SwiftMailer.

That still has not been updated, so please use sparkpost plugin as reference.

Hope this helps.

Best, M

---

<div class="post-metadata">

**Author:** ![econcoder](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/econcoder/32/11785_2.png) [@econcoder](https://forum.mautic.org/u/econcoder)\
**Post date:** [April 18, 2024, 4:49pm UTC](https://forum.mautic.org/t/postmark-plugin/31719/5 "2024-04-18T16:49:07Z")

</div>

Thank you for the responses!

With regard to batch sending, the Postmark side of batch sending is very straight forward, but with Mautic 5 being so new I’m not seeing any documentation on how to define the classes required for batch sending. Any pointers for the Mautic side? Otherwise, I’ll just start reading Mautic’s code.

---

<div class="post-metadata">

**Author:** ![mzagmajster](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/mzagmajster/32/687_2.png) [@mzagmajster](https://forum.mautic.org/u/mzagmajster)\
**Post date:** [April 18, 2024, 5:57pm UTC](https://forum.mautic.org/t/postmark-plugin/31719/6 "2024-04-18T17:57:47Z")

</div>

I would not anything useful in regards to batch sending in terms of code, but please do share you findings here ifyou decide to dive deep.
