# Sending transactional mail from third party site

**URL:** <https://forum.mautic.org/t/sending-transactional-mail-from-third-party-site/10580>\
**Category:** Product Support\
**Created:** [June 11, 2018, 9:22am UTC](https://forum.mautic.org/t/sending-transactional-mail-from-third-party-site/10580 "2018-06-11T09:22:08Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![echai](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/echai/32/340_2.png) [@echai](https://forum.mautic.org/u/echai)\
**Post date:** [June 11, 2018, 9:22am UTC](https://forum.mautic.org/t/sending-transactional-mail-from-third-party-site/10580/1 "2018-06-11T09:22:08Z")

</div>

Hi,

I have an ecommerce site. I am currently sending transactional mails from my server through aws SES. The mails for registration, order confirmation etc. I want to trigger the mails from my server but be able to track the open rate and create a drip campaign based on the open/click etc.

How do I start this in mautic?

---

<div class="post-metadata">

**Author:** ![petertl](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/petertl/32/511_2.png) [@petertl](https://forum.mautic.org/u/petertl)\
**Post date:** [June 12, 2018, 5:26am UTC](https://forum.mautic.org/t/sending-transactional-mail-from-third-party-site/10580/2 "2018-06-12T05:26:20Z")

</div>

I would start writing down all requirements and then evaluate if Mautic is the best solution for you.

Mautic will work perfect if you in fact only send transaction emails. But if you plan the implementation of drip campaigns, you might want to put external content (product recommendations, cross/upselling products etc.) into your emails. And Mautic does not have its strengths in doing so. At least not in version 2. AFAIK version 3 will have a flexible data model which might then work for you.

---

<div class="post-metadata">

**Author:** ![echai](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/echai/32/340_2.png) [@echai](https://forum.mautic.org/u/echai)\
**Post date:** [June 13, 2018, 5:49am UTC](https://forum.mautic.org/t/sending-transactional-mail-from-third-party-site/10580/3 "2018-06-13T05:49:19Z")

</div>

Thnaks PeterTL.

Where do I start for the transactional mails? How do I trigger it from my application server?

I am OK to not have product recommmendations etc. as of now, as the drip campaign will have mostly static text. I just want the ability to measure the emails that I am sending.

---

<div class="post-metadata">

**Author:** ![petertl](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/petertl/32/511_2.png) [@petertl](https://forum.mautic.org/u/petertl)\
**Post date:** [June 13, 2018, 8:00am UTC](https://forum.mautic.org/t/sending-transactional-mail-from-third-party-site/10580/4 "2018-06-13T08:00:49Z")

</div>

Use Mautic API to create contacts based on actions on your e-commerce app server. Put the Mautic contacts into segments or tag them and use campaigns to trigger transaction emails or drip flows.

Currenty, Mautic has one limitation which you might want to consider: Every contact can pass through every campaign only one single time. This might not be a problem if you e.g. implement a campaign in which you welcome your contact after registration. It looks a bit different if you implement functionality the user can pass multiple times (e.g. forgot password email). This is currently not possible within Mautic. However, there is a feature request which is flagged for the next release ([https://github.com/mautic/mautic/issues/1606](https://github.com/mautic/mautic/issues/1606)).

---

<div class="post-metadata">

**Author:** ![alban](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/alban/32/1959_2.png) [@alban](https://forum.mautic.org/u/alban)\
**Post date:** [June 17, 2018, 5:36am UTC](https://forum.mautic.org/t/sending-transactional-mail-from-third-party-site/10580/5 "2018-06-17T05:36:13Z")

</div>

Hi Chaiman,  
My preferred way to send transactional emails through Mautic is to use the Mautic API and, more specifically the method sendToContact, from the email endpoint. It takes, for parameters, the ID of an email template that you created, and the ID of the contact in Mautic (To obtain the ID, you can use the contact endpoint and pass the email).  
A third, optional, parameter can be passed: An array of parameters. For example if you pass “price”:“30”, then all you need is to use the token {price} in your email template, to display “30” in your email content.  
That way you can send any email, as many times as you need to a given contact. Besides, you will be able to monitor read rate and click rate for your transactional emails.  
Hope it helps.

---

<div class="post-metadata">

**Author:** ![echai](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/echai/32/340_2.png) [@echai](https://forum.mautic.org/u/echai)\
**Post date:** [June 18, 2018, 1:56am UTC](https://forum.mautic.org/t/sending-transactional-mail-from-third-party-site/10580/6 "2018-06-18T01:56:08Z")

</div>

Thanks Alban and PeterTL. Will try this.

---

<div class="post-metadata">

**Author:** ![petertl](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/petertl/32/511_2.png) [@petertl](https://forum.mautic.org/u/petertl)\
**Post date:** [June 20, 2018, 1:40pm UTC](https://forum.mautic.org/t/sending-transactional-mail-from-third-party-site/10580/7 "2018-06-20T13:40:21Z")

</div>

Hi @alban, I am very interested in what you wrote. 🙂 I did not know that I am able to pass values via the API which are then displayed in the email. I tried the following:

```auto
$emailApi = $api->newApi('emails', $auth, '...URL...');
$data = array(
	'testTag'	=> 'This is some text'
);
$email = $emailApi->sendToContact(84, 1, $data);

```

In the email I used the {testTag} and then I sent it out. Unfortunately the tag was not replaced when the email was delivered to my inbox.

Any idea is appreciated!

---

<div class="post-metadata">

**Author:** ![brad-kinksters](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/brad-kinksters/32/8873_2.png) [@brad-kinksters](https://forum.mautic.org/u/brad-kinksters)\
**Post date:** [December 16, 2022, 3:29am UTC](https://forum.mautic.org/t/sending-transactional-mail-from-third-party-site/10580/8 "2022-12-16T03:29:46Z")

</div>

The tokens must be specified as an array of keys=\>values in a `tokens` key in the parameters, not directly as parameters.

---

<div class="post-metadata">

**Author:** ![shatskiozera](https://avatars.discourse-cdn.com/v4/letter/s/dc4da7/32.png) [@shatskiozera](https://forum.mautic.org/u/shatskiozera)\
**Post date:** [August 23, 2023, 9:24am UTC](https://forum.mautic.org/t/sending-transactional-mail-from-third-party-site/10580/9 "2023-08-23T09:24:37Z")

</div>

Hi there!

Is it possible to send abandoned cart info to the email in such a way?

---

<div class="post-metadata">

**Author:** ![joeyk](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/joeyk/32/11164_2.png) [@joeyk](https://forum.mautic.org/u/joeyk)\
**Post date:** [August 23, 2023, 9:28am UTC](https://forum.mautic.org/t/sending-transactional-mail-from-third-party-site/10580/10 "2023-08-23T09:28:05Z")

</div>

Yes, you can send individual content like this.

---

<div class="post-metadata">

**Author:** ![shatskiozera](https://avatars.discourse-cdn.com/v4/letter/s/dc4da7/32.png) [@shatskiozera](https://forum.mautic.org/u/shatskiozera)\
**Post date:** [August 23, 2023, 10:12am UTC](https://forum.mautic.org/t/sending-transactional-mail-from-third-party-site/10580/11 "2023-08-23T10:12:17Z")

</div>

So do we simply need to create an email with a Product card block, add tokens there to get the image URL/price/description/etc, and send the info to Mautic through API?

And tokens must be specified here:

```auto
 "dynamicContent":[  
      {  
        "tokenName":null,
        "content":null,
        "filters":[  
          {  
            "content":null,
            "filters":[  
              {  
                "glue":null,
                "field":null,
                "object":null,
                "type":null,
                "operator":null,
                "display":null,
                "filter":null
              }
            ]

```

Just need it clarified as you answered in another discussion that for the native dynamic content we can’t use a structured source, like a JSON. I’m new with Mautic 🫣

> [@Products in email](https://forum.mautic.org/t/products-in-email/23984/8):
>
> You can also use OR you can add the native dynamic content but then you can’t use structured source, like a Json.
