Skip to content
/ go-etm Public

go-etm, easy hyperlink manipulation for email campaign

License

Notifications You must be signed in to change notification settings

bentol/go-etm

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

go-etm, html hyperlink manipulation for email campaign

Installation

$ go get github.com/benibudiharto/go-etm

How to use

package main

import (
  "github.com/benibudiharto/go-etm"
  "fmt"
)

func main() {
    params := map[string]string{"utm_campaign": "new-year-sale", "utm_source": "email"}
    html   := "<html>" +
                "<head></head>" +
                "<body>" +
                    "<a href='http://example.com' x-button='buy'>Buy</a>" +
                    "<br/>" +
                    "<div>" +
                        "<a href='http://example.com/register' x-button='register'>Register</a>" +
                    "</div>" +
                "</body>" +
              "</html>"
    fmt.Println(etm.Convert(html, params))
}

Result

<html>
<head></head>
<body>
    <a href="http://example.com?utm_campaign=new-year-sale&amp;utm_source=email&amp;x-button=buy" x-button="buy">Buy</a>
    <br/>
    <div>
        <a href="http://example.com/register?utm_campaign=new-year-sale&amp;utm_source=email&amp;x-button=register" x-button="register">Register</a>
    </div>
</body>
</html>

About

go-etm, easy hyperlink manipulation for email campaign

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages