Re: [Trac] Re: How can I modify the ticket link in notifications

2021-01-04 Thread Chris Nelson
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  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+unsubscr...@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.


Re: [Trac] Re: How can I modify the ticket link in notifications

2020-12-05 Thread Christopher Nelson
On Fri, Dec 4, 2020 at 10:45 PM Christopher Nelson <
chris.nelson.1...@gmail.com> wrote:

> On Fri, Dec 4, 2020 at 7:43 PM RjOllos  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 .

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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/trac-users/CAFFqYiAja%3DwvNiyvJvsp28PWTa9Ah11OK4L8RhpGNenNPBxNmg%40mail.gmail.com.


Re: [Trac] Re: How can I modify the ticket link in notifications

2020-12-04 Thread RjOllos


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  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+unsubscr...@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: [Trac] Re: How can I modify the ticket link in notifications

2020-12-04 Thread Christopher Nelson
On Fri, Dec 4, 2020 at 9:01 PM RjOllos  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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/trac-users/CAFFqYiAEgPwb38mY8xcDK0pRNBAgG4LL6bdNsaTWt9QPC4LaQA%40mail.gmail.com.


Re: [Trac] Re: How can I modify the ticket link in notifications

2020-12-04 Thread RjOllos


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  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  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  
 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: >>
>>> 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+unsubscr...@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: [Trac] Re: How can I modify the ticket link in notifications

2020-12-04 Thread Christopher Nelson
On Fri, Dec 4, 2020 at 7:43 PM 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  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 
>>> 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: >
>> 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+unsubscr...@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.


[Trac] Re: How can I modify the ticket link in notifications

2020-12-04 Thread RjOllos


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


Re: [Trac] Re: How can I modify the ticket link in notifications

2020-12-04 Thread RjOllos


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  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  
>>> 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: >
>> 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+unsubscr...@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: [Trac] Re: How can I modify the ticket link in notifications

2020-12-04 Thread RjOllos


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  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  
>> 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: 
> 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+unsubscr...@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: [Trac] Re: How can I modify the ticket link in notifications

2020-12-04 Thread Christopher Nelson
On Thu, Dec 3, 2020 at 2:03 PM RjOllos  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  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: 

[Trac] Re: How can I modify the ticket link in notifications

2020-12-03 Thread RjOllos


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  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+unsubscr...@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.


[Trac] Re: How can I modify the ticket link in notifications

2020-12-03 Thread Chris Nelson
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  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+unsubscr...@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.


[Trac] Re: How can I modify the ticket link in notifications

2020-11-25 Thread RjOllos


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  
> 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+unsubscr...@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.