Ticket body is generated from a ClearSilver template.

FWIW: You might use a fake environment as it is already done in the unit tests.
Note that you need a fake environment for the request, but the real
environment to store the new ticket, so this is probably as simple as
in the unit tests.

Have a look at the notification unit tests
(/trac/tests/notification.py). These tests have been introduced in
[2799], so you need checkout the trunk to get the code (not available
in 0.9.x)

HTH,
Manu

On 1/23/06, Kilian CAVALOTTI <[EMAIL PROTECTED]> wrote:
> Hi all,
>
> I recently discovered and installed the email2trac extension, which aims to
> create tickets from received mail. It works very well, but I'd like to be
> notified (by mail) when a new ticket is submitted this way.
>
> Ideally, it would work as described below:
>
>             mail               mail
>      user -------> new ticket ------> admin
>             (1)                 (2)
>
> Currently, part(1) works well, and I'd like to implement part(2).
>
> Part(1) uses a python script, which basically get email contents, and creates
> a new ticket:
>         tkt = self.new_ticket(self.env)
>         tkt['status'] = 'new'
>         ...
>
> So, I'd like to be able to invoke the TicketNotifyEmail() function, just after
> the ticket creation, as below:
>         tn = TicketNotifyEmail(self.env)
>         tn.notify(tkt, newticket=True)
>
> Unfortunately, it seems that the TicketNotifyEmail is a subclass of Notify,
> which wants to  populate_hdf(self.hdf, env) with plenty of
> HTML-request-related variables, which are not available there, since the
> script is not called from the web server.
>
> So I'd like to know if I can bypass the HTML-request-related stuff, and
> basically send a mail, without being forced to fake request environment. Or
> if that can't be done, how to create a false web environment, to make the
> Notify class believe it has been invoked from the web pages.
>
> Thanks in advance,
> Regards,
>
> --
> Kilian CAVALOTTI                      Administrateur réseaux et systèmes
> UPMC / CNRS - LIP6 (C870)
> 8, rue du Capitaine Scott                          Tel. : 01 44 27 88 54
> 75015 Paris - France                               Fax. : 01 44 27 70 00
> _______________________________________________
> Trac-dev mailing list
> [email protected]
> http://lists.edgewall.com/mailman/listinfo/trac-dev
>


--
Manu
_______________________________________________
Trac-dev mailing list
[email protected]
http://lists.edgewall.com/mailman/listinfo/trac-dev

Reply via email to