# Copy button beside asset url

**URL:** <https://forum.mautic.org/t/copy-button-beside-asset-url/36290>\
**Category:** Ideas and Feature Requests\
**Created:** [August 9, 2025, 12:19pm UTC](https://forum.mautic.org/t/copy-button-beside-asset-url/36290 "2025-08-09T12:19:00Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![lolcode](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/lolcode/32/12928_2.png) [@lolcode](https://forum.mautic.org/u/lolcode)\
**Post date:** [August 9, 2025, 12:19pm UTC](https://forum.mautic.org/t/copy-button-beside-asset-url/36290/1 "2025-08-09T12:19:00Z")

</div>

**My idea is:**

Add a copy button beside the asset url on the view asset page.

**I think these groups of people would benefit from this idea:**

Most users of Mautic

**Why I think they would benefit from this idea:**

It’s a time saver for anyone copying the link into an email or onto another website.

**Any code or resources to support this idea:**

No, but I can write it

**Are you willing to work on this idea?:**

Yes

**What skills and resources do you need to explore this further?**

I would like someone to let me know if this UI element appears anywhere else in the Mautic codebase so that the styles can be re-used

---

<div class="post-metadata">

**Author:** ![silavapi](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/silavapi/32/7424_2.png) [@silavapi](https://forum.mautic.org/u/silavapi)\
**Post date:** [August 11, 2025, 2:28pm UTC](https://forum.mautic.org/t/copy-button-beside-asset-url/36290/2 "2025-08-11T14:28:33Z")

</div>

Hey there!

Thanks for the suggestion, in fact we have a PR which is introducing a template for this exact behaviour:

> <https://github.com/mautic/mautic/pull/15127>
>
> | Q | A
> | --------------------------------…------ | ---
> | Bug fix? (use the a.b branch) | ❌ 
> | New feature/enhancement? (use the a.x branch) | ✔️
> | Deprecations? | ❌
> | BC breaks? (use the c.x branch) | ❌
> | Automated tests included? | ❌ 
> | Related user documentation PR URL | mautic/user-documentation#... 
> | Related developer documentation PR URL | mautic/developer-documentation-new#... 
> | Issue(s) addressed | Fixes #... 
> 
> 
> 
> \## Description
> 
> This PR adds a component for showing code snippets across the platform.
> It's useful for scenarios where the user needs to copy code to paste in external systems.
> 
> \### Form embed options
> 
> !\[image\](https://github.com/user-attachments/assets/fda7a220-17b3-4fa4-a72d-3b8ee40d0f92)
> 
> 
> \### Plugin config
> 
> !\[image\](https://github.com/user-attachments/assets/21f09255-384b-4d61-a8e6-c3856779d2d9)
> 
> \### Tracking script
> 
> !\[image\](https://github.com/user-attachments/assets/9f61fa02-fc57-41d6-a1cd-9e38fcd044dd)
> 
> 
> 
> 
> 
> 
> \---
> \### 📋 Steps to test this PR:
> 
> 
> 1. Open this PR on Gitpod or pull down for testing locally (see docs on testing PRs \[here\](https://contribute.mautic.org/contributing-to-mautic/tester))
> 2. Open Configuration page \> Tracking settings
> 3. See the block with a partial code
> 4. Click on the copy button to copy the code
> 5. Paste in an editor to see the code is complete (way bigger than compared to what you see on Mautic's config page)
> 6. Open Components \> Forms
> 7. Click to create a new form
> 8. Fill required information, just enough so you can save it
> 9. Save & Close
> 10. On the Form implementation tile, click to expand it
> 11. Select the first button (Embedded)
> 12. On the opened dialog, click on any of the copy options and paste somewhere to check if the code shown on the screen is the same you pasted 
> 13. Click to close the dialog
> 14. Now pick the implementation Self-hosted
> 15. See another dialog opened on your screen, now with different content
> 16. Click on one of the copy buttons, and paste the code somewhere to see it starts with \`\<script type="text/javascript"\`

It hasn’t landed in the asset bundle yet but I have no doubt it’ll be ported there at some point in the near future. If you’re able to help reviewing and testing that PR then we can make that happen quicker!

cc @andersoneccel for visibility.

---

<div class="post-metadata">

**Author:** ![lolcode](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/lolcode/32/12928_2.png) [@lolcode](https://forum.mautic.org/u/lolcode)\
**Post date:** [August 13, 2025, 11:16pm UTC](https://forum.mautic.org/t/copy-button-beside-asset-url/36290/3 "2025-08-13T23:16:09Z")

</div>

I see that the one you mentioned got merged. Yay!

I did a bit of code review plus manual testing and I found a couple of small issues. What is the protocol? Would I create a new pull request just for this issue and anything else minor?

Or could I merge that with a pull request for adding this behaviour to the asset page?

How separate does this project prefer these to be? Probably separate?

---

<div class="post-metadata">

**Author:** ![silavapi](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/silavapi/32/7424_2.png) [@silavapi](https://forum.mautic.org/u/silavapi)\
**Post date:** [August 14, 2025, 7:57am UTC](https://forum.mautic.org/t/copy-button-beside-asset-url/36290/4 "2025-08-14T07:57:19Z")

</div>

Thanks for doing the review and testing!

If you find some bugs or issues and you know how to fix them, first off I’d check if there are any reports in the issue queue so you can mark them as resolved with your fix - you can also raise an issue if you want, so others find it. Then if you can, please make a PR. Bug fixes should go against the 6.0 branch, you can also make a mirror PR against 7.x if you have the time which makes life a bit easier for our release leads not having to back-merge. We’ve got some docs on making the PR on the [Community Handbook](https://contribute.mautic.org/contributing-to-mautic/developer/code/pull-requests).

We separate things out into one PR for one issue, so I’d suggest a bugfix first (6.0 and mirror on 7.x if you can), and then a separate feature PR to add the new feature on Assets - that must be against the 7.x branch as we only introduce features in the minor and major releases, of which 7.0 will be the next one.

Thanks for being up for contributing!
