This adds the Cc field when using the Review or the Comment function on
the website, and will add a list of all listed authors of the patch to
this. Should help people highlight it in their inboxes.
Suggested by José Luis Tallón
msg['To'] = settings.HACKERS_EMAIL
msg['From'] = "%s %s <%s>" % (request.user.first_name, request.user.last_name, UserWrapper(request.user).email)
+
+ # CC the authors of a patch, if there are any
+ authors = list(patch.authors.all())
+ if len(authors):
+ msg['Cc'] = ", ".join(["%s %s <%s>" % (a.first_name, a.last_name, UserWrapper(a).email) for a in authors])
+
msg['Date'] = formatdate(localtime=True)
msg['User-Agent'] = 'pgcommitfest'
msg['X-cfsender'] = request.user.username