#1286 closed defect (duplicate)
Add Option to append a host name to a user name for email notification
| Reported by: | Owned by: | Matthew Good | |
|---|---|---|---|
| Priority: | normal | Milestone: | |
| Component: | ticket system | Version: | 0.8 |
| Severity: | normal | Keywords: | |
| Cc: | brianlsmith@… | Branch: | |
| Release Notes: | |||
| API Changes: | |||
| Internal 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 , 21 years ago
comment:2 by , 21 years ago
| Resolution: | → duplicate |
|---|---|
| Status: | new → closed |
This is a duplicate of #464.
comment:3 by , 20 years ago
| Resolution: | duplicate |
|---|---|
| Status: | closed → reopened |
#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 , 20 years ago
| Owner: | changed from to |
|---|---|
| Status: | reopened → new |
#1931 has been marked as a duplicate of this ticket.
comment:5 by , 20 years ago
| Cc: | added |
|---|
comment:6 by , 20 years ago
| Resolution: | → duplicate |
|---|---|
| Status: | new → closed |
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.



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