Fix broken TrackLink tag correction
This commit is contained in:
parent
ac8c7ed93b
commit
a82a64adc4
|
@ -212,7 +212,7 @@ func (s SubscriberAttribs) Scan(src interface{}) error {
|
||||||
func (c *Campaign) CompileTemplate(f template.FuncMap) error {
|
func (c *Campaign) CompileTemplate(f template.FuncMap) error {
|
||||||
// Compile the base template.
|
// Compile the base template.
|
||||||
t := regexpLinkTag.ReplaceAllString(c.TemplateBody, regexpLinkTagReplace)
|
t := regexpLinkTag.ReplaceAllString(c.TemplateBody, regexpLinkTagReplace)
|
||||||
t = regexpViewTag.ReplaceAllString(c.TemplateBody, regexpViewTagReplace)
|
t = regexpViewTag.ReplaceAllString(t, regexpViewTagReplace)
|
||||||
baseTPL, err := template.New(BaseTpl).Funcs(f).Parse(t)
|
baseTPL, err := template.New(BaseTpl).Funcs(f).Parse(t)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return fmt.Errorf("error compiling base template: %v", err)
|
return fmt.Errorf("error compiling base template: %v", err)
|
||||||
|
@ -220,7 +220,7 @@ func (c *Campaign) CompileTemplate(f template.FuncMap) error {
|
||||||
|
|
||||||
// Compile the campaign message.
|
// Compile the campaign message.
|
||||||
t = regexpLinkTag.ReplaceAllString(c.Body, regexpLinkTagReplace)
|
t = regexpLinkTag.ReplaceAllString(c.Body, regexpLinkTagReplace)
|
||||||
t = regexpViewTag.ReplaceAllString(c.Body, regexpViewTagReplace)
|
t = regexpViewTag.ReplaceAllString(t, regexpViewTagReplace)
|
||||||
msgTpl, err := template.New(ContentTpl).Funcs(f).Parse(t)
|
msgTpl, err := template.New(ContentTpl).Funcs(f).Parse(t)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return fmt.Errorf("error compiling message: %v", err)
|
return fmt.Errorf("error compiling message: %v", err)
|
||||||
|
|
Loading…
Reference in New Issue