All,

Would it be possible to make the following line to the Mail task? 
foreach (string fileName in Files.FileNames) {
   try {
        string content = ReadFile(fileName);
        
content=Project.Properties.ExpandProperties(content,Location);//*******t
his is the proposed change*****
         if (!StringUtils.IsNullOrEmpty(content)) 
                                        {
                        bodyWriter.Write(content);
                        bodyWriter.WriteLine(string.Empty);
                    }
                } catch (Exception ex) {
                    Log(Level.Warning,
string.Format(CultureInfo.InvariantCulture,
                        "File '{0}' NOT added to message body. {1}",
fileName, 
                        ex.Message));
                }
            }

I am basically looking for properties to be expanded in the files that
are included as part of the message body.

For example, if your mail task is set up this way:
<mail   from="[EMAIL PROTECTED]" 
        mailhost="mailhost" 
        subject="Dev Daily Build ${app.version} - Complete" 
        tolist="[EMAIL PROTECTED]">
                        <files>
                                <include name="buildStartMessage.txt"/>
                        </files>
</mail>
${app.version} would get expanded in the subject line, but if you wanted
to add the version number to the body of the message, it would not get
expanded. This change would fix that.

If you would rather do it a different way, that's fine. I'd just like to
see this functionality included.

I've attached a patch file for this change.
J
259c259,261
<                     if (!StringUtils.IsNullOrEmpty(content)) {
---
>                                       
> content=Project.Properties.ExpandProperties(content,Location);
>                     if (!StringUtils.IsNullOrEmpty(content)) 
>                                       {

Reply via email to