Menu

Email Subject

Help
zythra
2008-02-28
2013-05-01
  • zythra

    zythra - 2008-02-28

    Is there anyway to change the e-mail subject?  Are there any arguments that can be passed to it?  Love the program by the way, much easier to get running than the Perl counterpart.

     
    • mmckechney

      mmckechney - 2008-02-29

      Zythra,
      Glad you like the program! Currently, there isn't any mechanism to change the subject of the e-mail, but it certainly sounds like a worthwhile enhancement. What kind of changes would you like to see?
      Mike

       
      • zythra

        zythra - 2008-02-29

        I'd like to be able to put the username of the person who did the commit.  When I used to use CVS I had it setup so that the names of the files changed were in the subject, I'd personally rather have that than the commit message.  With a long list of files it would get truncated, but I just like to see what files were changed at a glance.  Maybe the ability to set the formatting of the subject with arguments, something like:

        %r: %u - %f

        Where %r is the revision number, %u is the username, %f is the list of filenames.  Obviously my argument names don't matter, just used as an example.  ;-)

        This is all personal preference though, the program is quite nice as it is.  (I did post a bug this morning, but it's not a big one).

         
    • ollie stockley

      ollie stockley - 2008-04-02

      Mike, you said that there is no way to change the subject of the email, but the helpfile disagrees.  Unfortunately, the #user# bit doesn't actually work.  (All I get in the real email is the literal "#user# - #filename#" rather than the actual username and the filename).

      Love the software by the way- it does exactly what I need (I can live without the custom subject line for now...)

      -------- begin excerpt from the help file -----------

      MailTo

      <MailTo EMailAddress="michael@mckechney.com" EMailType="HTML" EMailSuppressionChar="~" CustomSubjectFormat="#user# - #fileNames#"/>

          * CustomSubjectFormat - optional. Allows you to define a custom message subject. The default message subject is the first 100 characters of the commit message followed by the revision number in square brackets. The custom format tokens are:
            #user# - User ID
            #commitMessage# - Commit Message
            #revision# - revision number
            #fileNames# - comma delimited file name list (no path information, just file names)
            #fielsWithPaths# - comma delimited file list with full repository path information

       
      • mmckechney

        mmckechney - 2008-04-02

        Ollie,
        You are correct, the help file does specify that functionality - it was added as a result of this post and I neglected to add a reply to that effect. The functionality was implemented in version 1.4.4.0. and I have retested just today and I am able to get it to work ok. Can you check to make sure that you have the latest version? If not, you can download it from the "downloads" menu option.

        If you do have the latest version and are still having an issue, could you send me your SubversionNotify.cfg and SubversionNotify.log files and I can try to track down the error (if you post them to the forum, please be sure to change any settings that should be kept confidential).

        And finally, thanks for the kind words and I'm glad you find the program useful. If you have any suggestions for enhancements, please let me know!

        Mike

         
        • ollie stockley

          ollie stockley - 2008-04-02

          I am running 1.4.4

          here's my .cfg (Which produced an email with (exactly) the following subject line: "#user# - #fileNames#")

          <?xml version="1.0" standalone="yes"?>
          <subversionNotifyConfig xmlns="http://www.mckechney.com/SubversionNotifyConfig.xsd">
              <SVNConfig ExePath="C:\\Program Files\\CollabNet Subversion Server\\svnlook.exe"/>
              <MailServer Name="exchange" Username="" Password="" FromAddress="DONOTREPLY_Subversion@nowherespecial.co.uk" EMailSubjectTag="[SVN]"/>
              <ReproPathConfig controlledPaths="/">
                  <MailTo EMailAddress="myrealaddress@somewhere.co.uk" EMailType="HTML" EMailSuppressionChar="" CustomSubjectFormat="#user# - #fileNames#"/>
                  <!--        <Execute Application="notepad.exe"/> -->
                  <DefaultLogMessage Text="#user# has decided not to add a log message"/>
                  <CommitRequirements FailureMessage="Please add a commit message so other people can tell what has changed">
                      <CommitRequirement Description="Any Text" Regex="\w"/>  -->
                                  <!--        <FolderNameExclusion  FolderName="Process" FolderNameRegex="\w"  FailureMessage="Failed on AddDelete" ControlledActionType="AddDelete"/> -->
                      <!--            <FileTypeExclusion FileNameRegex="\w" FailureMessage="Failed on AddDelete file type exclusion" ControlledActionType="AddDelete"/>
                  <FileTypeTagCheck FileExtension=".txt" FailureMessage="Failed on .txt AddDelete tag regex" ControlledActionType="AddDelete" Regex="\[\]"/> -->
                  </CommitRequirements>
                  <CommitterExclusions>
                      <CommitterExclude SvnID="mmckechn" CommitterExclusionType="ProcessExecution"/>
                  </CommitterExclusions>
              </ReproPathConfig>
              <LockedPaths>
              </LockedPaths>
              <!--    <PrePropChangeRequirements FailureMessage="A revision comment may only be changed if it includes a Change Request number. Please add [CR ###] to the changed message.">
                  <PrePropChangeRequirement Description="Bug Number" Regex="\[c?r? ?#?([0-9]+(?:\s*,?\s*[0-9]+)*)\]" IsBugMatch="true"/>
              </PrePropChangeRequirements> -->
          </subversionNotifyConfig>

          (I had to leave the commit requirements, committer exclusion and locked paths bits in otherwise it broke, but that's not a problem- you're unlikely to use my repo, and we liked the requirement for non-blank messages)

          The appropriate bit of the log looks like the following:

          [02/04/2008 16:24:24]        *************************
          [02/04/2008 16:24:24]        Staring process for Revision 23-1 [C:/TestRepo]
          [02/04/2008 16:24:24]        Configuration file deserialized
          [02/04/2008 16:24:24]        Commit Paths: //
          [02/04/2008 16:24:24]        Passed Folder Name Exclusion test.
          [02/04/2008 16:24:24]        Passed File Type Exclusion test.
          [02/04/2008 16:24:24]        Checking for FileType Requirements complete. Not Required.
          [02/04/2008 16:24:24]        Commit Regex Found: c
          [02/04/2008 16:24:24]        All Pre-commit checks passed.
          [02/04/2008 16:24:25]        *************************
          [02/04/2008 16:24:25]        Staring process for Revision 24 [C:/TestRepo]
          [02/04/2008 16:24:25]        Configuration file deserialized
          [02/04/2008 16:24:26]        HTML Message Generated
          [02/04/2008 16:24:26]        Generating e-mail message
          [02/04/2008 16:24:26]        Sent Revision 24 e-mail to: *_*_*_*_*_*_*_deleted*_*_*_*_*_*_*
          [02/04/2008 16:24:26]        Finished e-mail processing.
          [02/04/2008 16:24:26]        HTML file written to C:\Program Files\SubversionNotify\log\Revision 24.html
          [02/04/2008 16:24:26]        Finished processing Revision 24

          if you need any other debug info, or want me to run an instrumented build so you can get more info, drop me a line.

          cheers.

          Ollie

           
          • mmckechney

            mmckechney - 2008-04-02

            Ollie,
            Looks like you found a bug! After running through the code with your config file, I get an exception with regard to the EMailSuppressionChar. It looks like the 1.4.4 version doesn't like it when it's empty (I'll be certain to fix it in the next release). Try adding a character to that value, something like EMailSuppressionChar="~" and see if you can get it to work now.

            Sorry for the error.
            Mike

             
            • ollie stockley

              ollie stockley - 2008-04-03

              Hi Mike,

              Sorry, but that's not the whole solution...  It doesn't work for me...

              A copy of my new config and log files is below.

              Thanks for the speedy responses and looking into this.  It is appreciated!

              regards

              Ollie

              <?xml version="1.0" standalone="yes"?>
              <subversionNotifyConfig xmlns="http://www.mckechney.com/SubversionNotifyConfig.xsd">
                  <SVNConfig ExePath="C:\\Program Files\\CollabNet Subversion Server\\svnlook.exe"/>
                  <MailServer Name="exchange" Username="" Password="" FromAddress="DONOTREPLY_Subversion@opengi.co.uk" EMailSubjectTag="[SVN]"/>
                  <ReproPathConfig controlledPaths="/">
                      <MailTo EMailAddress="xxxxxxxxxxxxx@xxxxxx.co.uk" EMailType="HTML" EMailSuppressionChar="~" CustomSubjectFormat="#user# - #fileNames#"/>
                      <!--        <Execute Application="notepad.exe"/> -->
                      <DefaultLogMessage Text="#user# has decided not to add a log message"/>
                      <CommitRequirements FailureMessage="Please add a commit message so other people can tell what has changed">
                          <CommitRequirement Description="Any Text" Regex="\w"/>  -->
                                      <!--        <FolderNameExclusion  FolderName="Process" FolderNameRegex="\w"  FailureMessage="Failed on AddDelete" ControlledActionType="AddDelete"/> -->
                          <!--            <FileTypeExclusion FileNameRegex="\w" FailureMessage="Failed on AddDelete file type exclusion" ControlledActionType="AddDelete"/>
                      <FileTypeTagCheck FileExtension=".txt" FailureMessage="Failed on .txt AddDelete tag regex" ControlledActionType="AddDelete" Regex="\[\]"/> -->
                      </CommitRequirements>
                      <CommitterExclusions>
                          <CommitterExclude SvnID="mmckechn" CommitterExclusionType="ProcessExecution"/>
                      </CommitterExclusions>
                  </ReproPathConfig>
                  <LockedPaths>
                  </LockedPaths>
                  <!--    <PrePropChangeRequirements FailureMessage="A revision comment may only be changed if it includes a Change Request number. Please add [CR ###] to the changed message.">
                      <PrePropChangeRequirement Description="Bug Number" Regex="\[c?r? ?#?([0-9]+(?:\s*,?\s*[0-9]+)*)\]" IsBugMatch="true"/>
                  </PrePropChangeRequirements> -->
              </subversionNotifyConfig>

              and the log file

              [03/04/2008 08:54:58]        *************************
              [03/04/2008 08:54:58]        Staring process for Revision 25-1 [C:/TestRepo]
              [03/04/2008 08:54:59]        Configuration file deserialized
              [03/04/2008 08:54:59]        Commit Paths: //
              [03/04/2008 08:54:59]        Passed Folder Name Exclusion test.
              [03/04/2008 08:54:59]        Passed File Type Exclusion test.
              [03/04/2008 08:54:59]        Checking for FileType Requirements complete. Not Required.
              [03/04/2008 08:54:59]        Commit Regex Found: t
              [03/04/2008 08:54:59]        All Pre-commit checks passed.
              [03/04/2008 08:54:59]        *************************
              [03/04/2008 08:54:59]        Staring process for Revision 26 [C:/TestRepo]
              [03/04/2008 08:54:59]        Configuration file deserialized
              [03/04/2008 08:54:59]        HTML Message Generated
              [03/04/2008 08:54:59]        Generating e-mail message
              [03/04/2008 08:54:59]        Sent Revision 26 e-mail to: xxxxxxxxxx@xxxxxx.co.uk
              [03/04/2008 08:54:59]        Finished e-mail processing.
              [03/04/2008 08:54:59]        HTML file written to C:\Program Files\SubversionNotify\log\Revision 26.html
              [03/04/2008 08:54:59]        Finished processing Revision 26

               
              • mmckechney

                mmckechney - 2008-04-03

                Ollie,
                You have me stumped on this one. I have created a build with improved debugging to help identify the issue. Please download it from the SVN repository via this link: http://svn-notify.svn.sourceforge.net/viewvc/\*checkout*/svn-notify/trunk/SubversionNotify/bin/Debug/SubversionNotify.exe

                Then, in your SubversionNotify.cfg file, please add the attribute: LoggingLevel="DEBUG" to the root element so that it looks like -

                <subversionNotifyConfig xmlns="http://www.mckechney.com/SubversionNotifyConfig.xsd" LoggingLevel="DEBUG">

                Once you have done all of that, try another commit and see what happens. If you still get the error, please post the appropriate excerpt from your log file and I'll take another look.

                Thanks,
                Mike

                 
                • ollie stockley

                  ollie stockley - 2008-04-04

                  Hi Mike,

                  Here's the new bit of the logfile.

                  thanks

                  Ollie

                  [04/04/2008 09:08:21]        *************************
                  [04/04/2008 09:08:21]        Staring process for Revision 27-1 [C:/TestRepo]
                  [04/04/2008 09:08:22]        Configuration file deserialized. Logging level set to: DEBUG
                  [04/04/2008 09:08:22]        SubversionNotify, Version=1.4.4.1, Culture=neutral, PublicKeyToken=null
                  [04/04/2008 09:08:22]        Commit Paths: //
                  [04/04/2008 09:08:22]        Passed Folder Name Exclusion test.
                  [04/04/2008 09:08:22]        Passed File Type Exclusion test.
                  [04/04/2008 09:08:22]        Checking for FileType Requirements complete. Not Required.
                  [04/04/2008 09:08:22]        Commit Regex Found: t
                  [04/04/2008 09:08:22]        All Pre-commit checks passed.
                  [04/04/2008 09:08:22]        *************************
                  [04/04/2008 09:08:22]        Staring process for Revision 28 [C:/TestRepo]
                  [04/04/2008 09:08:22]        Configuration file deserialized. Logging level set to: DEBUG
                  [04/04/2008 09:08:22]        SubversionNotify, Version=1.4.4.1, Culture=neutral, PublicKeyToken=null
                  [04/04/2008 09:08:23]        HTML Message Generated
                  [04/04/2008 09:08:23]        Generating e-mail message
                  [04/04/2008 09:08:23]        Custom E-Mail Subject :: Format String Found: #user# - #fileNames#
                  [04/04/2008 09:08:23]        Custom E-Mail Subject :: #revision# value: 28
                  [04/04/2008 09:08:23]        Custom E-Mail Subject :: #commitMessage# value: test commit message
                  [04/04/2008 09:08:23]        Custom E-Mail Subject :: #user# value: ostockley
                  [04/04/2008 09:08:23]        Unable to send mail:
                  System.ArgumentOutOfRangeException: StartIndex cannot be less than zero.
                  Parameter name: startIndex
                     at System.String.InternalSubStringWithChecks(Int32 startIndex, Int32 length, Boolean fAlwaysCopy)
                     at System.String.Substring(Int32 startIndex, Int32 length)
                     at SubversionNotify.Program.FormatCustomSubject(String customFormatTemplate, CommitInfo commitData)
                     at SubversionNotify.Program.PostCommitProcessing(HTMLProcessor proc, subversionNotifyConfig cfg, String logFileName, String baseFolder)
                  [04/04/2008 09:08:23]        Finished e-mail processing.
                  [04/04/2008 09:08:23]        HTML file written to C:\Program Files\SubversionNotify\log\Revision 28.html
                  [04/04/2008 09:08:23]        Finished processing Revision 28

                   
                  • mmckechney

                    mmckechney - 2008-04-04

                    Ollie,
                    Thanks for the post. I have identified and fixed the issue. You can grab the new build (v1.4.4.2) from here:
                    http://svn-notify.svn.sourceforge.net/viewvc/\*checkout*/svn-notify/trunk/SubversionNotify/bin/Debug/SubversionNotify.exe

                    The issue rose from the fact that your files were committed to the root path of the repository. I didn't account for the fact that file paths for a root level commit don't include a "/" character. I was using that character as a split point for a substring function. Since it wasn't there, the exception was thrown and the subject format was not updated appropriately.

                    If this works for you, remember to set your LoggingLevel attribute to "INFO" or "ERROR" otherwise your log file will quickly bloat.

                    If you have any other issues or suggestions for improvement, please let me know.

                    Thanks,
                    Mike

                     
                    • ollie stockley

                      ollie stockley - 2008-04-07

                      Storming stuff- works a treat.

                      The irony was that it would have worked on my live implementation- just not on my test system.  It's all implemented now- I have happy users.

                      Excellent package- very handy.

                      thanks for your efforts.  I owe you a beer.

                      /Ollie

                       

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.