# How do you export emails?

**URL:** https://forum.mautic.org/t/how-do-you-export-emails/22268
**Category:** General Discussion
**Created:** [January 7, 2022, 1:59pm UTC](https://forum.mautic.org/t/how-do-you-export-emails/22268 "2022-01-07T13:59:32Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![peter\_k](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/peter_k/32/511_2.png) [@peter\_k](https://forum.mautic.org/u/peter_k)
#### Post date: [January 7, 2022, 1:59pm UTC](https://forum.mautic.org/t/how-do-you-export-emails/22268/1 "2022-01-07T13:59:32Z")

</div>

Hi,

is there a way to export the “source code” of the emails I created? I created some content for a long term nurturing sequence and would hate it, if that content got deleted by a malfunction/bug/etc. (Doesn’t have to be mautic related. A hack or user error could delete it, too.)

I guess that a database dump includes the emails, but I’d like to have a text file for every email.

Is that possible?

---

<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: [January 8, 2022, 3:37pm UTC](https://forum.mautic.org/t/how-do-you-export-emails/22268/2 "2022-01-08T15:37:06Z")

</div>

You can open the source code and copy + paste.

---

<div class="post-metadata">

### Author: ![jason\_nyc](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/jason_nyc/32/12895_2.png) [@jason\_nyc](https://forum.mautic.org/u/jason_nyc)
#### Post date: [July 18, 2024, 5:34pm UTC](https://forum.mautic.org/t/how-do-you-export-emails/22268/3 "2024-07-18T17:34:05Z")

</div>

Is this a feature that will be add in the near future, since re-creating emails after every update (since we all know that update button doesn’t work) is become stressful. I know you guys do a lot, can there be a talk about this… ty.

---

<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: [July 18, 2024, 7:02pm UTC](https://forum.mautic.org/t/how-do-you-export-emails/22268/4 "2024-07-18T19:02:35Z")

</div>

Hi, the solution is rather to have smooth updates, no?

---

<div class="post-metadata">

### Author: ![ricfreire](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/ricfreire/32/14973_2.png) [@ricfreire](https://forum.mautic.org/u/ricfreire)
#### Post date: [July 23, 2024, 3:05pm UTC](https://forum.mautic.org/t/how-do-you-export-emails/22268/5 "2024-07-23T15:05:34Z")

</div>

Hi @jason_nyc are you looking to create custom email or landing pages theme?

---

<div class="post-metadata">

### Author: ![sfahrenkrog1](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/sfahrenkrog1/32/4583_2.png) [@sfahrenkrog1](https://forum.mautic.org/u/sfahrenkrog1)
#### Post date: [July 25, 2024, 8:47am UTC](https://forum.mautic.org/t/how-do-you-export-emails/22268/6 "2024-07-25T08:47:25Z")

</div>

Hi Peter

You can use the following bash script to download all html for each email:

(please install the tool jq before and set API USER, PWD and API )

```auto
#!/bin/bash
# stop script run when error occurs
#set -euox pipefail

MAUTIC_API_USER=""
MAUTIC_API_PWD=""
MAUTIC_API_BASEURL="https://m.dev.testserver.online/api/"

ACTION="emails"
RESULTS=$(curl -s -X GET -u $MAUTIC_API_USER:$MAUTIC_API_PWD "${MAUTIC_API_BASEURL}${ACTION}?minimal=1" |jq -c '.emails[].id')

for row in $RESULTS; do
    ID="$row"
    
    curl -s -X GET -u $MAUTIC_API_USER:$MAUTIC_API_PWD "${MAUTIC_API_BASEURL}${ACTION}/${ID}" |jq -r '.email.customHtml | @sh' | tee "${ACTION}_${ID}.html"
done

```

It will download every email into a separate html file via the mautic api.

Greetings  
Sebastian
