On Wednesday, November 25, 2020 at 10:12:48 AM UTC-8 RjOllos wrote:

> On Wednesday, November 25, 2020 at 9:44:03 AM UTC-8 Chris Nelson wrote:
>
>> I'm using SendGrid as my mail relay for Trac 1.0.1 notifications.  It 
>> adds click tracking to URls so the footer of the notification looks a 
>> mess.  I can suppress this by adding "clicktracking=off" before "href" in 
>> the <a> tab but I can't figure out how to do that.  I've 
>> edited  ticket_notify_email.txt to end:
>>
>> ${_('Ticket URL: <%(link.replace("href", "clicktracking=off href"))s>', 
>> link=ticket.link}
>>
>> And a couple of other alternatives but the changes I thought were 
>> promising seem to be syntax errors which break the template and I don't get 
>> notified at all.  Genshi is not my strong suit so I'm kind of blindly 
>> trying things that seem like they might work but I could use some 
>> guidance.  Thanks.
>>
>
> Try this:
>
> ${_('Ticket URL: <%(link)s>', link=ticket.link.replace("href", 
> "clicktracking=off href")} 
>
> If that doesn't work, then:
>
> {% with link=ticket.link.replace("href", "clicktracking=off href") %}\
> ${_('Ticket URL: <%(link)s>', link=link} 
> {% end %}\
>
>
> Ryan
>

I didn't think this through. The emails are plain text, and "ticket.link" 
is just a unicode string, not an HTML element.
>>> env.abs_href.ticket(1)
u'http://example.org/trac.cgi/ticket/1'

However, I did find that click tracking can be turned off, and it worked on 
my end.
https://app.sendgrid.com/settings/tracking

[image: Screen Shot 2020-12-04 at 17.59.39.jpg] 

-- 
You received this message because you are subscribed to the Google Groups "Trac 
Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to trac-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/trac-users/f2fb6cbb-f52b-4cda-a56b-1d5d262cb458n%40googlegroups.com.

Reply via email to