Edgewall Software
Modify

Opened 15 years ago

Closed 14 years ago

Last modified 13 years ago

#1286 closed defect (duplicate)

Add Option to append a host name to a user name for email notification

Reported by: David_Chilton@… Owned by: Matthew Good
Priority: normal Milestone:
Component: ticket system Version: 0.8
Severity: normal Keywords:
Cc: brianlsmith@… Branch:
Release Notes:
API Changes:

Description

I've hacked Notify.py for 0.8 to do this for me, It'd be nice to have it built in.

say user1 submits a ticket. it would be nice to have a config option to notify user1@… without having to store the email address in the map (under 0.9 and later).

I added "smtp_to_append_host = example.com" to trac.ini, and then user1 gets concatentated with @example.com if the reporter didn't already include the @ symbol

Attachments (0)

Change History (6)

comment:1 by David_Chilton@…, 15 years ago

this is the modified get_recepients from Notify.py

    def get_recipients(self, tktid):
        # The old notification behavior is still available if always_notify_reporter
        # is set to true
        val = self.env.get_config('notification', 'always_notify_reporter', 'false')
        notify_reporter = val.lower() in TRUE
        
        emails = self.prev_cc
        cursor = self.db.cursor()
        # Harvest email addresses from the cc field
        cursor.execute('SELECT cc,reporter FROM ticket WHERE id=%s', tktid)
        row = cursor.fetchone()
        if row:
            emails += row[0] and self.parse_cc(row[0]) or []
            if notify_reporter:
                emails.append(row[1])

        if notify_reporter:
            cursor.execute('SELECT DISTINCT author,ticket FROM ticket_change '
                           ' WHERE ticket=%s', tktid)
            for author,ticket in cursor:
                emails.append(author)

        # Add smtp_always_cc address
        acc = self.env.get_config('notification', 'smtp_always_cc', '')
        if acc:
            emails += self.parse_cc(acc)
        
        #check append host if necessary
        appendhost = self.env.get_config('notification', 'smtp_to_append_host','')
        for e in emails:
            if e.find('@') < 0:
                if appendhost:
                    e+="@"
                    e+=appendhost

        # Remove duplicates
        result = []
        for e in emails:
            if e not in result:
                result.append(e)
        return result

comment:2 by Christopher Lenz, 15 years ago

Resolution: duplicate
Status: newclosed

This is a duplicate of #464.

comment:3 by Matthew Good, 14 years ago

Resolution: duplicate
Status: closedreopened

#464 was about sending emails to local system users, which we don't plan to support, but I think that configuring a default domain name is reasonable if users haven't configured their email settings.

comment:4 by Matthew Good, 14 years ago

Owner: changed from Jonas Borgström to Matthew Good
Status: reopenednew

#1931 has been marked as a duplicate of this ticket.

comment:5 by anonymous, 14 years ago

Cc: brianlsmith@… added

comment:6 by jornh, 14 years ago

Resolution: duplicate
Status: newclosed

Closed because #2365 is about the same and already contains a patch which takes the email_map[] lookup added in trac 0.9 into consideration.

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Matthew Good.
The resolution will be deleted. Next status will be 'reopened'.
to as closed The owner will be changed from Matthew Good to the specified user.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.