• Resolved newguy321123

    (@newguy321123)


    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
    Example 2
    Example 3

    Would someone be able to help?

    Thank you.

    • This topic was modified 4 years, 6 months ago by newguy321123.
    • This topic was modified 4 years, 6 months ago by newguy321123.
Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author micropat

    (@micropat)

    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

    (@newguy321123)

    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

    SPORTSWEAR
    https://mysite.com/SPORTSWEAR

    SPORTS COLLECTABLES
    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.