Changeset 046026 in indico


Ignore:
Timestamp:
02/08/10 17:19:55 (3 years ago)
Author:
Pedro Ferreira <jose.pedro.ferreira@…>
Branches:
master, burotel, hello-world-walkthrough, ipv6, new-webex, prov-dual-interface, v0.97-series, v0.98-series, v0.98.2, v0.98.3, v0.98b1, v0.98b2, v0.99, 051b2622c51afb171a1dedb46a0df4fbb0cbd02e, d9941f8582b36b24821a11ea5ba16fda6a457fb1
Children:
dab490, f3d0f4
Parents:
06ec19
git-author:
Cesar Munoz Orena <cesar.munoz.orena@…> (01/21/10 14:06:05)
git-committer:
Pedro Ferreira <jose.pedro.ferreira@…> (02/08/10 17:19:55)
Message:

[FIXED] Implement noreply@ address

  • A noreply@... address has been added in the configuration files, so now it will send the email with the conference address in the "From" field. If it's not specified, it will use the noreply address, and if this one is not specified neither it will use the one from before, Indico Support.
  • This applies for the registrations and the modification of registrations, for the evaluation (submission and modification) module and for the abstracts (abstract creation, abstract acceptance and rejection).
Files:
16 edited

Legend:

Unmodified
Added
Removed
  • etc/indico.conf.sample

    r040db3 r046026  
    103103 
    104104PublicSupportEmail   = "root@localhost" 
     105 
     106# NoReplyEmail is the email address showed when we do not want the users to answer 
     107# an automatically generated email. 
     108 
     109NoReplyEmail         = "noreply-root@localhost" 
    105110 
    106111 
  • indico/MaKaC/common/Configuration.py

    rc71c8b r046026  
    387387            'SupportEmail'         : 'root@localhost', 
    388388            'PublicSupportEmail'   : 'root@localhost', 
     389            'NoReplyEmail'         : 'noreply-root@localhost', 
    389390            'IndicoSearchServer'   : '', 
    390391            'IndicoSearchClass'    : 'MaKaC.search.invenioSEA.InvenioSEA', 
  • indico/MaKaC/common/fossilize.py

    r59ab92 r046026  
    1818def addFossil(klazz, fossils): 
    1919    """ Declares fossils for a class 
    20      
     20 
    2121        :param klazz: a class object 
    2222        :type klass: class object 
  • indico/MaKaC/common/info.py

    r6884f0 r046026  
    4141        self._supportEmail = "" 
    4242        self._publicSupportEmail = "" 
     43        self._noReplyEmail = "" 
    4344        self._city = "" 
    4445        self._country = "" 
     
    228229    def setPublicSupportEmail( self, newEmail ): 
    229230        self._publicSupportEmail = newEmail.strip() 
     231 
     232    def getNoReplyEmail( self, returnSupport=False ): 
     233        if not hasattr( self, "_noReplyEmail" ) or (self._noReplyEmail == "" and Config.getInstance().getNoReplyEmail() != ""): 
     234            self._noReplyEmail = Config.getInstance().getNoReplyEmail() 
     235 
     236        if self._noReplyEmail != "": 
     237            return self._noReplyEmail 
     238        elif returnSupport: 
     239            return self.getSupportEmail() 
     240        else: 
     241            return "" 
     242 
     243        return self._noReplyEmail 
     244 
     245    def setNoReplyEmail( self, newEmail ): 
     246        self._noReplyEmail = newEmail.strip() 
     247 
    230248 
    231249    def getCity( self ): 
  • indico/MaKaC/common/pendingQueues.py

    r9033fd r046026  
    120120    def getFromAddr(self): 
    121121        # TODO: There will be on "from address" from a conference, but what if there are more different conferences 
    122         supEmail=self._psList[0].getConference().getSupportEmail() 
     122        supEmail=self._psList[0].getConference().getSupportEmail(returnNoReply=True) 
    123123        if self._forceIndicoFromAddress or supEmail.strip()=="": 
    124124            info = HelperMaKaCInfo.getMaKaCInfoInstance() 
  • indico/MaKaC/conference.py

    r0d29a2 r046026  
    31403140        self.notifyModification() 
    31413141 
    3142     def getSupportEmail( self ): 
    3143         """Returns the support email address associated with the conference 
     3142    def getSupportEmail( self, returnNoReply=False ): 
     3143        """ 
     3144        Returns the support email address associated with the conference 
     3145        :param returnNoReply: Return no-reply address in case there's no support e-mail (default True) 
     3146        :type returnNoReply: bool 
     3147 
    31443148        """ 
    31453149        try: 
     
    31483152        except AttributeError, e: 
    31493153            self._supportEmail = "" 
    3150         return self._supportEmail 
     3154        if self._supportEmail.strip() == "" and returnNoReply: 
     3155            # In case there's no conference support e-mail, return the no-reply 
     3156            # address, and the 'global' support e-mail if there isn't one 
     3157            return HelperMaKaCInfo.getMaKaCInfoInstance().getNoReplyEmail(returnSupport=True) 
     3158        else: 
     3159            return self._supportEmail 
    31513160 
    31523161    def setSupportEmail( self, newSupportEmail ): 
  • indico/MaKaC/evaluation.py

    r9033fd r046026  
    14641464                    from MaKaC.common.timerExec import sendMail 
    14651465                    sm = sendMail() 
    1466                     sm.setFromAddr( HelperMaKaCInfo.getMaKaCInfoInstance().getSupportEmail() ) 
     1466                    supportEmail = evaluation.getConference().getSupportEmail(returnNoReply=True) 
     1467                    sm.setFromAddr(supportEmail) 
    14671468                    for to in toList: 
    14681469                        sm.addToAddr(to) 
  • indico/MaKaC/participant.py

    r9033fd r046026  
    582582         
    583583        createURL = urlHandlers.UHUserCreation.getURL() 
    584         data["fromAddr"] = info.HelperMaKaCInfo.getMaKaCInfoInstance().getSupportEmail() 
     584        data["fromAddr"] = info.HelperMaKaCInfo.getMaKaCInfoInstance().getNoReplyEmail(returnSupport=True) 
    585585        toList = [] 
    586586        toList.append(participant.getEmail()) 
     
    616616             
    617617        data = {} 
    618         data["fromAddr"] = info.HelperMaKaCInfo.getMaKaCInfoInstance().getSupportEmail() 
     618        data["fromAddr"] = info.HelperMaKaCInfo.getMaKaCInfoInstance().getNoReplyEmail(returnSupport=True) 
    619619        if len(self._dateNegotiation.getSolutionList()) == 0: 
    620620             
     
    10331033        if sendMail: 
    10341034            data = {} 
    1035             data["fromAddr"] = info.HelperMaKaCInfo.getMaKaCInfoInstance().getSupportEmail() 
     1035            data["fromAddr"] = info.HelperMaKaCInfo.getMaKaCInfoInstance().getNoReplyEmail(returnSupport=True) 
    10361036            confTitle = self._participation.getConference().getTitle() 
    10371037            data["subject"] = _("Your application for attendance in %s declined")%confTitle 
  • indico/MaKaC/registration.py

    r1ec0c1 r046026  
    628628 
    629629    def sendEmailNewRegistrant(self, regForm, rp): 
    630         fromAddr=regForm.getConference().getSupportEmail() 
     630        fromAddr=regForm.getConference().getSupportEmail(returnNoReply=True) 
    631631        url = urlHandlers.UHConferenceDisplay.getURL(regForm.getConference()) 
    632632 
     
    639639            paymentWarning = "." 
    640640 
    641         if fromAddr.strip()=="": 
    642             info = HelperMaKaCInfo.getMaKaCInfoInstance() 
    643             fromAddr = "%s <%s>"%(info.getTitle(), info.getSupportEmail()) 
    644641        subject= _("""New registrant in '%s': %s""")%(strip_ml_tags(regForm.getConference().getTitle()), rp.getFullName()) 
    645642        body=_(""" 
     
    675672        if not registrant.getConference().getModPay().isEnableSendEmailPaymentDetails(): 
    676673            return 
    677         fromAddr=registrant.getConference().getSupportEmail() 
     674        fromAddr=registrant.getConference().getSupportEmail(returnNoReply=True) 
    678675        date=registrant.getConference().getStartDate() 
    679676        getTitle=strip_ml_tags(registrant.getConference().getTitle()) 
    680677        idRegistrant=registrant.getIdPay() 
    681678        detailPayment=registrant.getConference().getModPay().getPaymentDetails() 
    682         if fromAddr.strip()=="": 
    683             info = HelperMaKaCInfo.getMaKaCInfoInstance() 
    684             fromAddr = "%s <%s>"%(info.getTitle(), info.getSupportEmail()) 
    685679        subject=_("""New registrant in '%s': %s - payment""")%(strip_ml_tags(registrant.getConference().getTitle()), registrant.getFullName()) 
    686680        body= _(""" 
     
    739733 
    740734    def sendEmailNewRegistrantConfirmPay(self, regForm,registrant): 
    741         fromAddr=registrant.getConference().getSupportEmail() 
     735        fromAddr=registrant.getConference().getSupportEmail(returnNoReply=True) 
    742736        date=registrant.getConference().getStartDate() 
    743737        getTitle=strip_ml_tags(registrant.getConference().getTitle()) 
    744738        idRegistrant=registrant.getIdPay() 
    745739 
    746         if fromAddr.strip()=="": 
    747             info = HelperMaKaCInfo.getMaKaCInfoInstance() 
    748             fromAddr = "%s <%s>"%(info.getTitle(), info.getSupportEmail()) 
    749740        subject= _("""New registrant in '%s': %s""")%(strip_ml_tags(registrant.getConference().getTitle()), registrant.getFullName()) 
    750741        body= _(""" 
     
    803794 
    804795    def sendEmailModificationRegistrant(self, regForm, rp): 
    805         fromAddr=regForm.getConference().getSupportEmail() 
    806         if fromAddr.strip()=="": 
    807             info = HelperMaKaCInfo.getMaKaCInfoInstance() 
    808             fromAddr = "%s <%s>"%(info.getTitle(), info.getSupportEmail()) 
     796        fromAddr=regForm.getConference().getSupportEmail(returnNoReply=True) 
    809797        subject= _("""Registration modified for '%s': %s""")%(strip_ml_tags(regForm.getConference().getTitle()), rp.getFullName()) 
    810798        body= _(""" 
  • indico/MaKaC/webinterface/common/abstractNotificator.py

    r1c9b696 r046026  
    2828from MaKaC.errors import MaKaCError 
    2929from MaKaC.i18n import _ 
     30from MaKaC.common.info import HelperMaKaCInfo 
    3031 
    3132class ConfTitleTplVar(TplVar): 
     
    236237     
    237238    def notify(self,abstract,tpl): 
     239        #if no from address is specified we should put the default one 
     240        if tpl.getFromAddr().strip() == "": 
     241            tpl.setFromAddr(tpl.getConference().getSupportEmail(returnNoReply=True)) 
     242 
    238243        sm=GenericMailer.send(self.apply(abstract,tpl)) 
    239244         
  • indico/MaKaC/webinterface/mail.py

    r420dc1 r046026  
    118118 
    119119class Mailer: 
    120      
    121     def send( notification ): 
     120 
     121    def send( notification, fromAddress="" ): 
    122122        info = HelperMaKaCInfo.getMaKaCInfoInstance() 
    123         fromAddr = "%s <%s>"%(info.getTitle(), info.getSupportEmail()) 
     123        if fromAddress.strip() == "": 
     124            fromAddr = "%s <%s>"%(info.getTitle(), info.getSupportEmail()) 
     125        else: 
     126            fromAddr = notification.getFromAddr() 
    124127        toAddr = str(notification.getDestination().getEmail()) 
    125128        text = """%s 
     
    151154                        self._user.getId(), \ 
    152155                        self._user.getKey()) 
    153         maildata = { "fromAddr": "Indico Mailer<%s>"%HelperMaKaCInfo.getMaKaCInfoInstance().getSupportEmail(), "toList": [self._user.getEmail()], "subject": _("[%s] Confirmation request")%getSubjectIndicoTitle(), "body": text } 
     156        maildata = { "fromAddr": "Indico Mailer<%s>"%HelperMaKaCInfo.getMaKaCInfoInstance().getNoReplyEmail(returnSupport=True), "toList": [self._user.getEmail()], "subject": _("[%s] Confirmation request")%getSubjectIndicoTitle(), "body": text } 
    154157        GenericMailer.send(GenericNotification(maildata)) 
    155158 
     
    168171<%s> 
    169172"""% (name,urlHandlers.UHUserDetails.getURL( self._user )) 
    170         maildata = { "fromAddr": "Indico Mailer<%s>" % minfo.getSupportEmail(), "toList": minfo.getAdminEmails(), "subject": _("[Indico] New account creation request"), "body": text } 
     173        maildata = { "fromAddr": "Indico Mailer<%s>" % minfo.getNoReplyEmail(returnSupport=True), "toList": minfo.getAdminEmails(), "subject": _("[Indico] New account creation request"), "body": text } 
    171174        GenericMailer.send(GenericNotification(maildata)) 
    172175 
     
    200203Thank you for using Indico. 
    201204                """)%(self._user.getIdentityList()[0].getLogin()) 
    202         maildata = { "fromAddr": "Indico Mailer<%s>"%minfo.getSupportEmail(), "toList": [self._user.getEmail()], "subject": _("[%s] Registration accepted")%getSubjectIndicoTitle(), "body": text } 
     205        maildata = { "fromAddr": "Indico Mailer<%s>"%minfo.getNoReplyEmail(returnSupport=True), "toList": [self._user.getEmail()], "subject": _("[%s] Registration accepted")%getSubjectIndicoTitle(), "body": text } 
    203206        GenericMailer.send(GenericNotification(maildata)) 
    204207     
     
    227230                text += _("Password:%s\n")%l[2] 
    228231                text += "==================\n" 
    229         maildata = { "fromAddr": "Indico Mailer<%s>"%HelperMaKaCInfo.getMaKaCInfoInstance().getSupportEmail(), "toList": [self._user.getEmail()], "subject": _("[%s] Login Information")%getSubjectIndicoTitle(), "body": text } 
    230         GenericMailer.send(GenericNotification(maildata)) 
     232        maildata = { "fromAddr": "Indico Mailer<%s>"%HelperMaKaCInfo.getMaKaCInfoInstance().getNoReplyEmail(returnSupport=True), "toList": [self._user.getEmail()], "subject": _("[%s] Login Information")%getSubjectIndicoTitle(), "body": text } 
     233        GenericMailer.send(GenericNotification(maildata)) 
  • indico/MaKaC/webinterface/pages/admins.py

    rab21d77 r046026  
    164164        vars["supportEmail"] = minfo.getSupportEmail() 
    165165        vars["publicSupportEmail"] = minfo.getPublicSupportEmail() 
     166        vars["noReplyEmail"] = minfo.getNoReplyEmail() 
    166167        vars["lang"] = minfo.getLang() 
    167168        vars["address"] = "" 
     
    262263        vars["publicSupportEmail"] = genInfo.getPublicSupportEmail() 
    263264        vars["city"] = genInfo.getCity() 
    264         vars["country"] = genInfo.getCountry()  
     265        vars["country"] = genInfo.getCountry() 
     266        vars["noReplyEmail"] = genInfo.getNoReplyEmail() 
    265267        try: 
    266268            selected_tz = genInfo.getTimezone() 
  • indico/MaKaC/webinterface/rh/CFADisplay.py

    r9033fd r046026  
    306306 
    307307    def getFromAddr(self): 
    308         if self._conf.getSupportEmail().strip()!="": 
    309             return self._conf.getSupportEmail() 
    310         else: 
    311             return HelperMaKaCInfo.getMaKaCInfoInstance().getSupportEmail() 
    312              
     308        return self._conf.getSupportEmail(returnNoReply=True) 
     309 
    313310    def getCCList(self): 
    314311        return self._abstract.getOwner().getSubmissionNotification().getCCList() 
     
    398395        #   the user to be logged in and therefore all the checking below is not 
    399396        #   necessary 
     397 
    400398        if self._getUser() == None: 
    401399            return 
     
    479477            a.addTrack( track ) 
    480478        a.setComments(self._abstractData.comments) 
     479 
     480 
    481481        #The commit must be forced before sending the confirmation 
    482482        DBMgr.getInstance().commit() 
    483483        #Email confirmation about the submission 
    484         mail.Mailer.send( _AbstractSubmissionNotification( a ) ) 
     484        mail.Mailer.send( _AbstractSubmissionNotification( a ), self._conf.getSupportEmail(returnNoReply=True) ) 
    485485        #Email confirmation about the submission to coordinators 
    486486        if cfaMgr.getSubmissionNotification().hasDestination(): 
  • indico/MaKaC/webinterface/rh/admins.py

    r8126f9 r046026  
    204204            self._minfo.setSupportEmail( params["supportEmail"] ) 
    205205            self._minfo.setPublicSupportEmail( params["publicSupportEmail"] ) 
     206            self._minfo.setNoReplyEmail( params["noReplyEmail"] ) 
    206207            self._minfo.setCity( params["city"] ) 
    207208            self._minfo.setCountry( params["country"] ) 
  • indico/MaKaC/webinterface/tpls/Admins.tpl

    r9033fd r046026  
    4141    </tr> 
    4242    <tr> 
     43      <td nowrap class="dataCaptionTD"><span class="dataCaptionFormat"><%= _("No reply email")%><br/><%= _("(for automatic messages that don't need answer)")%></span></td> 
     44      <td bgcolor="white" width="100%%" valign="top" class="blacktext"><%= escape(noReplyEmail) %></td> 
     45    </tr> 
     46    <tr> 
    4347      <td nowrap class="dataCaptionTD"><span class="dataCaptionFormat"> <%= _("Language")%></span></td> 
    4448      <td bgcolor="white" width="100%%" valign="top" class="blacktext"><%= _(lang)%></td> 
  • indico/MaKaC/webinterface/tpls/GeneralInfoModification.tpl

    r9033fd r046026  
    3434      <td bgcolor="white" width="100%%">&nbsp; 
    3535        <input type="text" size="50" name="publicSupportEmail" value="%(publicSupportEmail)s"> 
     36      </td> 
     37    </tr> 
     38    <tr> 
     39      <td nowrap class="titleCellTD"><span class="titleCellFormat"><%= _("No reply email")%><br><%= _("(for automatic messages that don't need answer)")%></span></td> 
     40      <td bgcolor="white" width="100%%">&nbsp; 
     41        <input type="text" size="50" name="noReplyEmail" value="%(noReplyEmail)s"> 
    3642      </td> 
    3743    </tr> 
Note: See TracChangeset for help on using the changeset viewer.