Sending a Transactional Email using the API?

cto

New Member
I reviewed the API v2 documentation and the API code for `Transactional_emailsController.php`, but I still do not understand how MailWizz API is used for sending a transactional email.

Is this the endpoint I'm supposed to use: https://api-docs.mailwizz.com/#create-a-transactional-email ?

Which property do I set for using a template, is it `template_uid`...?

And how do I pass data variables like ['activationUrl' => '...', 'username' => '...', etc].

Or, do I have to manually get the template content, interpolate the data variables, and pass that content as the `body` property?

Also, once I "create" a transactional email, I'm assuming it will be queued and sent once the cron task triggers?
 
Or, do I have to manually get the template content, interpolate the data variables, and pass that content as the `body` property?
This is it. You have to build your email content on your own.

Also, once I "create" a transactional email, I'm assuming it will be queued and sent once the cron task triggers?
Correct. You have a dashboard for that in backend area.
 
It sounds like there really isn't any support for transactional email, in MailWizz it's just an afterthought. But this is a basic feature in email services like Mailjet, Bird CRM, etc.

So fields like `[UNSUBSCRIBE_URL]` and `EMAIL`, there's no support for interpolating these with transactional email templates?

Is there at least an API endpoint I can use to pass template_uid/vars and get back a compiled HTML body?

I guess that means tracking URLs won't be auto-interpolated as well, so I won't be able to track clicks?

How do you suggest I programmatically generate the UNSUBSCRIBE_URL and tracking links?
 
Last edited:
Transactional emails are not meant for tracking users, they will not do such thing. They are used for things like recover password emails, report emails, etc.
Every email communication with your subscribers must go through campaigns, where you cna properly track them.
 
So, for example, we have a website which generates a daily activity email for each user. The email is unique for each user, based on the content of that user's account.

We are starting with a template, looping through a list of variable data that is displayed in the email (using template FOREACH loop and IF conditionals), adding an unsubscribe link so the user can opt-out of further daily activity emails.

And we do want tracking on the link clicks, because that gives us feedback to see if the user is engaging or not.

You are suggesting to setup this daily email as a campaign, and to setup a field that gets pushed/synced on a daily basis with the variable data (ie. [DAILY_ACTIVITY_LIST]...?)

So then, is there a way to trigger the email to send when the DAILY_ACTIVITY_LIST field is updated for a user?

[Edit:] So I've been playing around with the Customer and Backend dashboards, and I don't think what I mentioned above will be possible, as I don't see the concept of a Contact Property/Contact Attribute anywhere. I see that Campaigns are also based on a sending date, so there's no other way to set a different type of trigger (ie. when a Contact Property is updated).

Our website is more reliant on Transactional Emails and Contact Properties, rather than Campaign-style emails, so I misunderstood the capabilities of MailWizz when we started setting it up.

What we really wanted was a clean way for managing our email templates with a drag-drop editor that non-technical staff could edit by themselves, with some automation for bounces & unsubscribes. But without the Transactional email templating, we're missing key features.
 
Last edited:
To send a campaign based on a custom field value, you can use autoresponders along with segments. Start by creating a segment that filters subscribers based on the specific value in your DAILY_ACTIVITY_LIST custom field. Then, set up an autoresponder campaign that targets this segment, so it only reaches subscribers who meet the custom field criteria.

Experimenting with these settings can help you refine your approach and see if it meets your needs. With a bit of testing, you should be able to align the configuration with your specific requirements.
 
Back
Top