Mailing List Archive

How can I modify the ticket link in notifications
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.

--
Christopher Nelson, PE
Professional Software Engineer
@ChrisNelsonPE
LinkedIn.com/in/ChrisNelsonPE
NoPerfectProgram.Wordpress.com

--
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+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/trac-users/CAFFqYiAkxwLtFG1J%3DjifeodHmRK4XS4Q3H6cZHqcfKO-aHUdkg%40mail.gmail.com.
Re: How can I modify the ticket link in notifications [ In reply to ]
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

--
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+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/trac-users/b11b0ff6-2691-4574-84f4-f34f45aa88a4n%40googlegroups.com.
Re: How can I modify the ticket link in notifications [ In reply to ]
Thanks. I'll try that. But I realize I'm going to need to also handle
links in the body of the notification (e.g., if a comment or ticket
description change includes a link).

On Wednesday, November 25, 2020 at 1:12:48 PM UTC-5 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
>

--
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+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/trac-users/7f83019d-632e-4cba-93d4-67bd04a60d7fn%40googlegroups.com.
Re: How can I modify the ticket link in notifications [ In reply to ]
On Thursday, December 3, 2020 at 6:52:31 AM UTC-8 Chris Nelson wrote:

> Thanks. I'll try that. But I realize I'm going to need to also handle
> links in the body of the notification (e.g., if a comment or ticket
> description change includes a link).
>

I use SendGrid for my Trac development instances. How are the <a> elements
formatted when click tracking is enabled? The emails I receive to gmail
have a "data-saferedirecturl" attribute that looks like it might be related
to the click tracking, but I don't know how click tracking works.

Ryan

--
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+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/trac-users/26aebb73-9866-489b-a3d9-1140e4f098fcn%40googlegroups.com.
Re: Re: How can I modify the ticket link in notifications [ In reply to ]
On Thu, Dec 3, 2020 at 2:03 PM RjOllos <rjollos@gmail.com> wrote:

> On Thursday, December 3, 2020 at 6:52:31 AM UTC-8 Chris Nelson wrote:
>
>> Thanks. I'll try that. But I realize I'm going to need to also handle
>> links in the body of the notification (e.g., if a comment or ticket
>> description change includes a link).
>>
>
> I use SendGrid for my Trac development instances. How are the <a> elements
> formatted when click tracking is enabled? The emails I receive to gmail
> have a "data-saferedirecturl" attribute that looks like it might be related
> to the click tracking, but I don't know how click tracking works.
>

My email notifications come in with URLs that start like

Ticket URL: <https://u10800165.ct.sendgrid.net/ls/click?

then wrap to four more lines which look like gibberish. Clicking goes to
SendGrid, records my click, then redirects to Trac. It'd be nice if
SendGrid let you turn off click tracking by API key so one defaulted to on
and another defaulted to off but I don't seem to be able to find that, if
it exists.

I've edited every instance of `ticket_notify_email.txt` on my server (even
just to change "URL" to "url") but the change doesn't show up on
notifications, even after restarting `tracd`. My Trac admin skills are
really stale. :-(

--
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+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/trac-users/CAFFqYiDEp2%2BZ_tX%2BTWp%3Di9N2drP325guZA-kshO%2BFomh-CtzVw%40mail.gmail.com.
Re: Re: How can I modify the ticket link in notifications [ In reply to ]
On Friday, December 4, 2020 at 12:20:26 PM UTC-8 Chris Nelson wrote:

> On Thu, Dec 3, 2020 at 2:03 PM RjOllos <rjo...@gmail.com> wrote:
>
>> On Thursday, December 3, 2020 at 6:52:31 AM UTC-8 Chris Nelson wrote:
>>
>>> Thanks. I'll try that. But I realize I'm going to need to also handle
>>> links in the body of the notification (e.g., if a comment or ticket
>>> description change includes a link).
>>>
>>
>> I use SendGrid for my Trac development instances. How are the <a>
>> elements formatted when click tracking is enabled? The emails I receive to
>> gmail have a "data-saferedirecturl" attribute that looks like it might be
>> related to the click tracking, but I don't know how click tracking works.
>>
>
> My email notifications come in with URLs that start like
>
> Ticket URL: <https://u10800165.ct.sendgrid.net/ls/click?
>
> then wrap to four more lines which look like gibberish. Clicking goes to
> SendGrid, records my click, then redirects to Trac. It'd be nice if
> SendGrid let you turn off click tracking by API key so one defaulted to on
> and another defaulted to off but I don't seem to be able to find that, if
> it exists.
>
> I've edited every instance of `ticket_notify_email.txt` on my server (even
> just to change "URL" to "url") but the change doesn't show up on
> notifications, even after restarting `tracd`. My Trac admin skills are
> really stale. :-(
>

That's weird, I've never seen it, and I'm just using the free account.

To customize `ticket_notify_email.txt`, put a copy in $env/templates. It
should be picked up by a server restart.

Ryan

--
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+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/trac-users/f020655d-629d-4095-9e29-e51cf3df2f25n%40googlegroups.com.
Re: Re: How can I modify the ticket link in notifications [ In reply to ]
On Friday, December 4, 2020 at 4:43:18 PM UTC-8 RjOllos wrote:

> On Friday, December 4, 2020 at 12:20:26 PM UTC-8 Chris Nelson wrote:
>
>> On Thu, Dec 3, 2020 at 2:03 PM RjOllos <rjo...@gmail.com> wrote:
>>
>>> On Thursday, December 3, 2020 at 6:52:31 AM UTC-8 Chris Nelson wrote:
>>>
>>>> Thanks. I'll try that. But I realize I'm going to need to also handle
>>>> links in the body of the notification (e.g., if a comment or ticket
>>>> description change includes a link).
>>>>
>>>
>>> I use SendGrid for my Trac development instances. How are the <a>
>>> elements formatted when click tracking is enabled? The emails I receive to
>>> gmail have a "data-saferedirecturl" attribute that looks like it might be
>>> related to the click tracking, but I don't know how click tracking works.
>>>
>>
>> My email notifications come in with URLs that start like
>>
>> Ticket URL: <https://u10800165.ct.sendgrid.net/ls/click?
>>
>> then wrap to four more lines which look like gibberish. Clicking goes to
>> SendGrid, records my click, then redirects to Trac. It'd be nice if
>> SendGrid let you turn off click tracking by API key so one defaulted to on
>> and another defaulted to off but I don't seem to be able to find that, if
>> it exists.
>>
>> I've edited every instance of `ticket_notify_email.txt` on my server
>> (even just to change "URL" to "url") but the change doesn't show up on
>> notifications, even after restarting `tracd`. My Trac admin skills are
>> really stale. :-(
>>
>
> That's weird, I've never seen it, and I'm just using the free account.
>

Actually, just reproduced. Will investigate.


> To customize `ticket_notify_email.txt`, put a copy in $env/templates. It
> should be picked up by a server restart.
>
> Ryan
>

--
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+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/trac-users/0e9933dd-9f25-481b-97b3-c81b5db982acn%40googlegroups.com.
Re: How can I modify the ticket link in notifications [ In reply to ]
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+unsubscribe@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.
Re: Re: How can I modify the ticket link in notifications [ In reply to ]
On Fri, Dec 4, 2020 at 7:43 PM RjOllos <rjollos@gmail.com> wrote:

> On Friday, December 4, 2020 at 12:20:26 PM UTC-8 Chris Nelson wrote:
>
>> On Thu, Dec 3, 2020 at 2:03 PM RjOllos <rjo...@gmail.com> wrote:
>>
>>> On Thursday, December 3, 2020 at 6:52:31 AM UTC-8 Chris Nelson wrote:
>>>
>>>> Thanks. I'll try that. But I realize I'm going to need to also handle
>>>> links in the body of the notification (e.g., if a comment or ticket
>>>> description change includes a link).
>>>>
>>>
>>> I use SendGrid for my Trac development instances. How are the <a>
>>> elements formatted when click tracking is enabled? The emails I receive to
>>> gmail have a "data-saferedirecturl" attribute that looks like it might be
>>> related to the click tracking, but I don't know how click tracking works.
>>>
>>
>> My email notifications come in with URLs that start like
>>
>> Ticket URL: <https://u10800165.ct.sendgrid.net/ls/click?
>>
>> then wrap to four more lines which look like gibberish. Clicking goes to
>> SendGrid, records my click, then redirects to Trac. It'd be nice if
>> SendGrid let you turn off click tracking by API key so one defaulted to on
>> and another defaulted to off but I don't seem to be able to find that, if
>> it exists.
>>
>> I've edited every instance of `ticket_notify_email.txt` on my server
>> (even just to change "URL" to "url") but the change doesn't show up on
>> notifications, even after restarting `tracd`. My Trac admin skills are
>> really stale. :-(
>>
>
> That's weird, I've never seen it, and I'm just using the free account.
>

We are on Silver Tier (I think), the lowest paid level.

> To customize `ticket_notify_email.txt`, put a copy in $env/templates. It
> should be picked up by a server restart.
>
I'll try that. Thanks.

Is there a way to restart `tracd` other than killing and running it again?
I looked for a signal to send it or something but didn't find any
documentation.

--
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+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/trac-users/CAFFqYiDhUUyGGjz%3D8LMdEdUiPsqVAM5QY--Yc0MNA8T7G-Rvww%40mail.gmail.com.
Re: Re: How can I modify the ticket link in notifications [ In reply to ]
On Friday, December 4, 2020 at 7:45:45 PM UTC-8 Chris Nelson wrote:

> On Fri, Dec 4, 2020 at 7:43 PM RjOllos <rjo...@gmail.com> wrote:
>
>> On Friday, December 4, 2020 at 12:20:26 PM UTC-8 Chris Nelson wrote:
>>
>>> On Thu, Dec 3, 2020 at 2:03 PM RjOllos <rjo...@gmail.com> wrote:
>>>
>>>> On Thursday, December 3, 2020 at 6:52:31 AM UTC-8 Chris Nelson wrote:
>>>>
>>>>> Thanks. I'll try that. But I realize I'm going to need to also
>>>>> handle links in the body of the notification (e.g., if a comment or ticket
>>>>> description change includes a link).
>>>>>
>>>>
>>>> I use SendGrid for my Trac development instances. How are the <a>
>>>> elements formatted when click tracking is enabled? The emails I receive to
>>>> gmail have a "data-saferedirecturl" attribute that looks like it might be
>>>> related to the click tracking, but I don't know how click tracking works.
>>>>
>>>
>>> My email notifications come in with URLs that start like
>>>
>>> Ticket URL: <https://u10800165.ct.sendgrid.net/ls/click?
>>>
>>> then wrap to four more lines which look like gibberish. Clicking goes
>>> to SendGrid, records my click, then redirects to Trac. It'd be nice if
>>> SendGrid let you turn off click tracking by API key so one defaulted to on
>>> and another defaulted to off but I don't seem to be able to find that, if
>>> it exists.
>>>
>>> I've edited every instance of `ticket_notify_email.txt` on my server
>>> (even just to change "URL" to "url") but the change doesn't show up on
>>> notifications, even after restarting `tracd`. My Trac admin skills are
>>> really stale. :-(
>>>
>>
>> That's weird, I've never seen it, and I'm just using the free account.
>>
>
> We are on Silver Tier (I think), the lowest paid level.
>
>> To customize `ticket_notify_email.txt`, put a copy in $env/templates. It
>> should be picked up by a server restart.
>>
> I'll try that. Thanks.
>
> Is there a way to restart `tracd` other than killing and running it
> again? I looked for a signal to send it or something but didn't find any
> documentation.
>

I'm not aware of way, other than killing the process.

--
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+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/trac-users/68bd43be-91d5-4186-b9c2-c667c2d44595n%40googlegroups.com.
Re: Re: How can I modify the ticket link in notifications [ In reply to ]
On Fri, Dec 4, 2020 at 9:01 PM RjOllos <rjollos@gmail.com> wrote:

> 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'
>

Ah, so there's not "href" to replace! I think that to affect the body
(e.g., a comment or changed description), I need to do it in code. I'll
look into that.

> However, I did find that click tracking can be turned off, and it worked
> on my end.
> https://app.sendgrid.com/settings/tracking
>
>
Yes, but that is for the whole account. We use this for three different
applications and Trac is the only one where I know I don't want tracking.


--
Christopher Nelson, PE
Professional Software Engineer
@ChrisNelsonPE
LinkedIn.com/in/ChrisNelsonPE
NoPerfectProgram.Wordpress.com

--
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+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/trac-users/CAFFqYiAEgPwb38mY8xcDK0pRNBAgG4LL6bdNsaTWt9QPC4LaQA%40mail.gmail.com.
Re: Re: How can I modify the ticket link in notifications [ In reply to ]
On Friday, December 4, 2020 at 7:48:52 PM UTC-8 Chris Nelson wrote:

> On Fri, Dec 4, 2020 at 9:01 PM RjOllos <rjo...@gmail.com> wrote:
>
>> 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'
>>
>
> Ah, so there's not "href" to replace! I think that to affect the body
> (e.g., a comment or changed description), I need to do it in code. I'll
> look into that.
>
>> However, I did find that click tracking can be turned off, and it worked
>> on my end.
>> https://app.sendgrid.com/settings/tracking
>>
>>
> Yes, but that is for the whole account. We use this for three different
> applications and Trac is the only one where I know I don't want tracking.
>

I'm surprised SendGrid is modifying the plain text emails. You might have
to ask them if there's a way to do the equivalent of clicktracking=off for
plain text emails.

--
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+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/trac-users/604db06d-07d5-483d-86ad-5da6d103e6cbn%40googlegroups.com.
Re: Re: How can I modify the ticket link in notifications [ In reply to ]
On Fri, Dec 4, 2020 at 10:45 PM Christopher Nelson <
chris.nelson.1022@gmail.com> wrote:

> On Fri, Dec 4, 2020 at 7:43 PM RjOllos <rjollos@gmail.com> wrote:
>
>> To customize `ticket_notify_email.txt`, put a copy in $env/templates. It
>> should be picked up by a server restart.
>>
> I'll try that. Thanks.
>

What confused me was there was no template there to start with. When I put
one there, it is used. I'm not sure where it gets the default if there
isn't one in the environment <shrug>.

I'm guessing that the <%(link)s> in the template's footer is handled by
Genshi so just changing Trac source (which I'd have to do for links in the
body) isn't going to fix that. :-( I guess I'll go see what SendGrid can
do for me.

Chris
--
Christopher Nelson, PE
Professional Software Engineer
@ChrisNelsonPE
LinkedIn.com/in/ChrisNelsonPE
NoPerfectProgram.Wordpress.com

--
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+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/trac-users/CAFFqYiAja%3DwvNiyvJvsp28PWTa9Ah11OK4L8RhpGNenNPBxNmg%40mail.gmail.com.
Re: Re: How can I modify the ticket link in notifications [ In reply to ]
On Sat, Dec 5, 2020 at 4:41 AM Christopher Nelson <
chris.nelson.1022@gmail.com> wrote:

> On Fri, Dec 4, 2020 at 10:45 PM Christopher Nelson <
> chris.nelson.1022@gmail.com> wrote:
>
>> On Fri, Dec 4, 2020 at 7:43 PM RjOllos <rjollos@gmail.com> wrote:
>>
>>> To customize `ticket_notify_email.txt`, put a copy in $env/templates. It
>>> should be picked up by a server restart.
>>>
>> I'll try that. Thanks.
>>
>
> What confused me was there was no template there to start with. When I
> put one there, it is used. I'm not sure where it gets the default if there
> isn't one in the environment <shrug>.
>

The default is contained in the egg or wheel.
$ ls
~/.pyenv/versions/trac-2.7/lib/python2.7/site-packages/Trac-1.4.2-py2.7.egg/trac/ticket/templates/ticket_notify_email.txt
/Users/rjollos/.pyenv/versions/trac-2.7/lib/python2.7/site-packages/Trac-1.4.2-py2.7.egg/trac/ticket/templates/ticket_notify_email.txt

A template in $env/templates with the same name as a Trac or plugin
templates will override Trac or the plugin, but in general, it's not
recommended because you need to re-apply your changes each time the
template changes in an upgrade.
https://trac.edgewall.org/wiki/TracInterfaceCustomization#ProjectTemplates

ticket_notify_email.txt, is a special case in that it doesn't change very
often. But good to keep a diff or your changes so you can apply them to a
copy of a new template after upgrade.

I'm working this week on upgrading a Trac site in which the previous
maintainer had made copies of various templates like wiki_view.html in an
earlier version of Trac, probably 1.0.3. The templates were all customized.
Now they are on Trac 1.0.9 and several features are broken because they are
serving modified versions of 1.0.3 templates. I'm talking them to 1.0.20,
then hopefully 1.2.6 and 1.4.2 eventually. Things would get worse and worse
if we continued using 1.0.3 templates through those upgrade steps.

The next step is to go through all those templates and diff them, figure
out what the customizations are, and hopefully implement those the right
way: via ITemplateStreamFilter (deprecated in Trac 1.4) or JavaScript.

Customizing the notification template is probably the most typical use case
for $env/templates. You are right, the tricky thing is to know how to get
the template and copy it there. You can fetch it from the Trac repository
or copy it from the install location if you know where to find it.

We could consider adding a trac-admin command.

trac-admin $env extract_template ticket_notify_email.txt

But per my example, we don't want to make it too easy for users to
customize templates, at least without making the warnings about the risks
much more prominent and frequent.

I'm guessing that the <%(link)s> in the template's footer is handled by
> Genshi so just changing Trac source (which I'd have to do for links in the
> body) isn't going to fix that. :-( I guess I'll go see what SendGrid can
> do for me.
>
> Chris
> --
> Christopher Nelson, PE
> Professional Software Engineer
> @ChrisNelsonPE
> LinkedIn.com/in/ChrisNelsonPE
> NoPerfectProgram.Wordpress.com
>
> --
> 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+unsubscribe@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/trac-users/CAFFqYiAja%3DwvNiyvJvsp28PWTa9Ah11OK4L8RhpGNenNPBxNmg%40mail.gmail.com
> <https://groups.google.com/d/msgid/trac-users/CAFFqYiAja%3DwvNiyvJvsp28PWTa9Ah11OK4L8RhpGNenNPBxNmg%40mail.gmail.com?utm_medium=email&utm_source=footer>
> .
>

--
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+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/trac-users/CA%2BBGpn-Z9mL_MtPgTgk3S39AGXBmcGKRguk5hwLtBcBnqtBy2w%40mail.gmail.com.
Re: Re: How can I modify the ticket link in notifications [ In reply to ]
I got this resolved by creating a subuser in my SendGrid account, turning
off tracking for that subuser, and creating an API key for that subuser
which I could use to send email from Trac without click tracking.

On Friday, December 4, 2020 at 10:55:54 PM UTC-5 RjOllos wrote:

> On Friday, December 4, 2020 at 7:48:52 PM UTC-8 Chris Nelson wrote:
>
>> On Fri, Dec 4, 2020 at 9:01 PM RjOllos <rjo...@gmail.com> wrote:
>>
>>> 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'
>>>
>>
>> Ah, so there's not "href" to replace! I think that to affect the body
>> (e.g., a comment or changed description), I need to do it in code. I'll
>> look into that.
>>
>>> However, I did find that click tracking can be turned off, and it worked
>>> on my end.
>>> https://app.sendgrid.com/settings/tracking
>>>
>>>
>> Yes, but that is for the whole account. We use this for three different
>> applications and Trac is the only one where I know I don't want tracking.
>>
>
> I'm surprised SendGrid is modifying the plain text emails. You might have
> to ask them if there's a way to do the equivalent of clicktracking=off for
> plain text emails.
>

--
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+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/trac-users/ec735506-1e03-47bf-909e-7129949464c2n%40googlegroups.com.