# Repated email links not replaced

**URL:** https://forum.mautic.org/t/repated-email-links-not-replaced/3349
**Category:** Product Support
**Created:** [January 29, 2016, 4:28pm UTC](https://forum.mautic.org/t/repated-email-links-not-replaced/3349 "2016-01-29T16:28:32Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![ramez\_rafla](https://avatars.discourse-cdn.com/v4/letter/r/8c91f0/32.png) [@ramez\_rafla](https://forum.mautic.org/u/ramez_rafla)
#### Post date: [January 29, 2016, 4:28pm UTC](https://forum.mautic.org/t/repated-email-links-not-replaced/3349/1 "2016-01-29T16:28:32Z")

</div>

Hello,  
  
  
  
We are about to launch our first Mautic email campaign (~100k users) - all is looking good, until we faced this bug:  
  
  
  
Only the first incidence of a URL gets replaced with the Mautic one (for tracking / redirect).  
  
Our work-around was to add bogus GET variables:

Code:

&\_debug=2

  
My guess is that the RegExp is missing the

Code:

/g

flag ![:)]( ":)") or maybe a loop around the replace  
  
PS: Will prepare a write up of our story as it might serve as a good starting point for newbies / those contemplating switching

---

<div class="post-metadata">

### Author: ![ramez\_rafla](https://avatars.discourse-cdn.com/v4/letter/r/8c91f0/32.png) [@ramez\_rafla](https://forum.mautic.org/u/ramez_rafla)
#### Post date: [January 29, 2016, 4:28pm UTC](https://forum.mautic.org/t/repated-email-links-not-replaced/3349/2 "2016-01-29T16:28:32Z")

</div>

Hello,

We are about to launch our first Mautic email campaign (~100k users) - all is looking good, until we faced this bug:

Only the first incidence of a URL gets replaced with the Mautic one (for tracking / redirect).  
Our work-around was to add bogus GET variables: `&_debug=2`

My guess is that the RegExp is missing the `/g` flag 🙂 or maybe a loop around the replace

PS: Will prepare a write up of our story as it might serve as a good starting point for newbies / those contemplating switching

---

<div class="post-metadata">

### Author: ![gmillard](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/gmillard/32/5_2.png) [@gmillard](https://forum.mautic.org/u/gmillard)
#### Post date: [January 29, 2016, 6:22pm UTC](https://forum.mautic.org/t/repated-email-links-not-replaced/3349/3 "2016-01-29T18:22:30Z")

</div>

Can you make sure this gets reported on [https://github.com/mautic/mautic/issues](https://github.com/mautic/mautic/issues)?

Thanks!  
Alan

---

<div class="post-metadata">

### Author: ![garylancast](https://avatars.discourse-cdn.com/v4/letter/g/eada6e/32.png) [@garylancast](https://forum.mautic.org/u/garylancast)
#### Post date: [February 15, 2016, 9:10am UTC](https://forum.mautic.org/t/repated-email-links-not-replaced/3349/4 "2016-02-15T09:10:59Z")

</div>

Yeah Alan. I am facing a similar problem.

Internet   
facebook   
Mautic

 ![Mautic is open source marketing automation](http://marketing.zo2jo2bexx11-stage.in/email/56c193d0ba035.gif)--\_av-FE8\_o6HnNIvbqNSlaVyp6A--

The links are not being replaced in the
