Mautic Community Forums

Sending transactional mail from third party site

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?

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.

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.

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).

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.

Thanks Alban and PeterTL. Will try this.

Hi @alban, I am very interested in what you wrote. :slight_smile: 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:

$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!