Title: How to insert URL into Additional Javascript
Last modified: September 2, 2020

---

# How to insert URL into Additional Javascript

 *  Resolved [newguy321123](https://wordpress.org/support/users/newguy321123/)
 * (@newguy321123)
 * [5 years, 9 months ago](https://wordpress.org/support/topic/how-to-insert-url-into-additional-javascript/)
 * I am not a Javascript coder (as you can see)…but I am looking at how to add more
   content to the email template.
 * Currently the template is
 * a2a_config.templates.email = {
    subject: “Have you seen this? ${title}?”, body:“
   It looks pretty interesting. Have a look ${link} \nThey also have other things
   you might like. \nFor example,” };
 * After **For example,**, I would like to add (if it were in HTML)
 * [Example 1](https://www...com)
    [Example 2](https://www...com) [Example 3](https://www...com)
 * Would someone be able to help?
 * Thank you.
    -  This topic was modified 5 years, 9 months ago by [newguy321123](https://wordpress.org/support/users/newguy321123/).
    -  This topic was modified 5 years, 9 months ago by [newguy321123](https://wordpress.org/support/users/newguy321123/).

Viewing 2 replies - 1 through 2 (of 2 total)

 *  Plugin Author [micropat](https://wordpress.org/support/users/micropat/)
 * (@micropat)
 * [5 years, 9 months ago](https://wordpress.org/support/topic/how-to-insert-url-into-additional-javascript/#post-13353324)
 * Something like:
 *     ```
       // Get the "href" attribute value of <a class="example_html_element" href="https://example.com/1">Example 1</a>
       var example_element = document.querySelector('a.example_html_element');
       var example_href = example_element.href;
       var template_body = "";
   
       if (example_href) {
         template_body_examples = "\nThey also have other things you might like.\nFor example, "
           + example_href;
       }
   
       a2a_config.templates.email = {
         subject: "Have you seen this? ${title}?",
         body: "It looks pretty interesting. Have a look ${link}"
           + template_body_examples
       };
       ```
   
 *  Thread Starter [newguy321123](https://wordpress.org/support/users/newguy321123/)
 * (@newguy321123)
 * [5 years, 9 months ago](https://wordpress.org/support/topic/how-to-insert-url-into-additional-javascript/#post-13353510)
 * micropat,
    Thank you for the quick reply. Unfortunately that is a step above 
   my skill level. I have tried to pick it up but no luck.
 * Could you dumb it down a bit?
 * For example, if there are 3 products
 * SPORTS FIGURES
    [https://mysite.com/SPORTSFIGURES](https://mysite.com/SPORTSFIGURES)
 * SPORTSWEAR
    [https://mysite.com/SPORTSWEAR](https://mysite.com/SPORTSWEAR)
 * SPORTS COLLECTABLES
    [https://mysite.com/SPORTSCOLLECTABLES](https://mysite.com/SPORTSCOLLECTABLES)
 * How would the code you supplied look?
 * Thank you for the help.
    It is appreciated.

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘How to insert URL into Additional Javascript’ is closed to new replies.

 * ![](https://ps.w.org/add-to-any/assets/icon.svg?rev=972738)
 * [AddToAny Share Buttons](https://wordpress.org/plugins/add-to-any/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/add-to-any/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/add-to-any/)
 * [Active Topics](https://wordpress.org/support/plugin/add-to-any/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/add-to-any/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/add-to-any/reviews/)

## Tags

 * [add links](https://wordpress.org/support/topic-tag/add-links/)
 * [email](https://wordpress.org/support/topic-tag/email/)
 * [template](https://wordpress.org/support/topic-tag/template/)
 * [url](https://wordpress.org/support/topic-tag/url/)

 * 2 replies
 * 2 participants
 * Last reply from: [newguy321123](https://wordpress.org/support/users/newguy321123/)
 * Last activity: [5 years, 9 months ago](https://wordpress.org/support/topic/how-to-insert-url-into-additional-javascript/#post-13353510)
 * Status: resolved