# Customize an email text for each contact using AI

**URL:** <https://forum.mautic.org/t/customize-an-email-text-for-each-contact-using-ai/33218>\
**Category:** Product Support\
**Tags:** mautic-4\
**Created:** [August 22, 2024, 7:30pm UTC](https://forum.mautic.org/t/customize-an-email-text-for-each-contact-using-ai/33218 "2024-08-22T19:30:11Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![erthal](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/erthal/32/6285_2.png) [@erthal](https://forum.mautic.org/u/erthal)\
**Post date:** [August 22, 2024, 7:30pm UTC](https://forum.mautic.org/t/customize-an-email-text-for-each-contact-using-ai/33218/1 "2024-08-22T19:30:11Z")

</div>

**Your software**  
My Mautic version is: 4.4.10  
My PHP version is: 8.0.30  
My Database type and version is: 10.4.34-MariaDB-1:10.4.34+maria~ubu2004

**Your problem**

Hi Folks, I am playing around wit GPT and I would like to change the drip email to send personalized information for each contact.

I did not find any mautic API that I could change the email content that will be sent to a specific contact in a campaign.

Any idea how to implement such a thing?

---

<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, 2024, 6:14am UTC](https://forum.mautic.org/t/customize-an-email-text-for-each-contact-using-ai/33218/2 "2024-08-23T06:14:57Z")

</div>

Is this a Segment send or Campaign send?

---

<div class="post-metadata">

**Author:** ![erthal](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/erthal/32/6285_2.png) [@erthal](https://forum.mautic.org/u/erthal)\
**Post date:** [August 23, 2024, 6:15pm UTC](https://forum.mautic.org/t/customize-an-email-text-for-each-contact-using-ai/33218/3 "2024-08-23T18:15:44Z")

</div>

I was thinking about a campaign send. But I am open to hear how to do it with segment.

---

<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 24, 2024, 6:52am UTC](https://forum.mautic.org/t/customize-an-email-text-for-each-contact-using-ai/33218/4 "2024-08-24T06:52:15Z")

</div>

There is no plugin that supports this directly.  
What you can do is to create a custom field with long text. This text will be the custom content of your email.

Create a function in n8n that receives parameters (including contact id) calls chatgpt, creates the content and pushes the custom content into mautic via api.

Now create a campaign that passes the parameters to n8n via webhook.

The webhook will activate the n8n function, and mautic will receive the updated custom content via api from n8n. The second campaign step can be sending the email with the custom content token.

---

<div class="post-metadata">

**Author:** ![erthal](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/erthal/32/6285_2.png) [@erthal](https://forum.mautic.org/u/erthal)\
**Post date:** [August 26, 2024, 12:20pm UTC](https://forum.mautic.org/t/customize-an-email-text-for-each-contact-using-ai/33218/5 "2024-08-26T12:20:13Z")

</div>

HI @joeyk ,

Yes, This is the only solution that I have figure out. I was wondering if there was a better sollution.

Anyway, thanks for the help!

---

<div class="post-metadata">

**Author:** ![erthal](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/erthal/32/6285_2.png) [@erthal](https://forum.mautic.org/u/erthal)\
**Post date:** [September 23, 2024, 7:02pm UTC](https://forum.mautic.org/t/customize-an-email-text-for-each-contact-using-ai/33218/6 "2024-09-23T19:02:38Z")

</div>

@joeyk,

found a problem with this aproach. The fields have max length of 191

It´s not enough to work with a more refined approach…

Any thoughts?

---

<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:** [September 24, 2024, 5:36am UTC](https://forum.mautic.org/t/customize-an-email-text-for-each-contact-using-ai/33218/7 "2024-09-24T05:36:27Z")

</div>

Make a longer field: Textfield in Mautic
