Fix broken TrackLink tag correction

This commit is contained in:
Kailash Nadh 2018-11-03 18:55:19 +05:30
parent ac8c7ed93b
commit a82a64adc4
2 changed files with 2 additions and 8 deletions

View File

@ -212,7 +212,7 @@ func (s SubscriberAttribs) Scan(src interface{}) error {
func (c *Campaign) CompileTemplate(f template.FuncMap) error {
// Compile the base template.
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)
if err != nil {
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.
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)
if err != nil {
return fmt.Errorf("error compiling message: %v", err)

6
todo
View File

@ -1,6 +0,0 @@
- Add quote support to Quill link feature so that Track function can be inserted
- Make {{ template }} a Regex check to account for spaces
- Add css inliner
- Duplicate mails to subscribers in multiple lists under one campaign?
- HTML syntax highlighting