Topic
  • 7 replies
  • Latest Post - ‏2013-01-11T18:48:14Z by SystemAdmin
kknb0800
kknb0800
4 Posts

Pinned topic Is it possible to dynamically insert date in email subject line?

‏2009-12-01T09:24:06Z |
Hi All,

I don't know if this is possible but I have a set of monthly reports that run as part of a Job and are sent via email to various different people. Is it possible to somehow get Cognos to insert the date into the subject line of the email?

So I'm looking for something like:

<Report Name> - <date>

I've been getting nowhere with this and would really appreciate any help.

Many thanks!
Updated on 2013-01-11T18:48:14Z at 2013-01-11T18:48:14Z by SystemAdmin
  • kknb0800
    kknb0800
    4 Posts

    Re: Is it possible to dynamically insert date in email subject line?

    ‏2009-12-01T09:30:34Z  
    I forgot to mention that I'm working with Cognos 8.1.

    Thanks
  • SystemAdmin
    SystemAdmin
    15496 Posts

    Re: Is it possible to dynamically insert date in email subject line?

    ‏2009-12-01T13:44:27Z  
    • kknb0800
    • ‏2009-12-01T09:30:34Z
    I forgot to mention that I'm working with Cognos 8.1.

    Thanks
    Hi kknb0800

    I guess you are using the "Send by email" option in Cognos. I am afraid you can't add dynamic content to the subject/body of the email.
    If you want, you can add Javacript code into the body (if you send the email as HTML), so you can calculate at least the date, but just in the body.

    Another option is to use Event Studio (the "Send an email" task in Event Studio permits to add dynamic content), but I am not sure if this option would satisfy your requirements.

    Also, the version I am using is Cognos 8.4. I don't know if in Cognos 8.1 you can do the things I explained above.

    Hope this helps

    AlexPM
  • kknb0800
    kknb0800
    4 Posts

    Re: Is it possible to dynamically insert date in email subject line?

    ‏2009-12-02T08:52:50Z  
    Hi kknb0800

    I guess you are using the "Send by email" option in Cognos. I am afraid you can't add dynamic content to the subject/body of the email.
    If you want, you can add Javacript code into the body (if you send the email as HTML), so you can calculate at least the date, but just in the body.

    Another option is to use Event Studio (the "Send an email" task in Event Studio permits to add dynamic content), but I am not sure if this option would satisfy your requirements.

    Also, the version I am using is Cognos 8.4. I don't know if in Cognos 8.1 you can do the things I explained above.

    Hope this helps

    AlexPM
    Thanks Alex for your quick reply.

    Unfortunately I have to send stuff out in excel so html is not an option.
  • SystemAdmin
    SystemAdmin
    15496 Posts

    Re: Is it possible to dynamically insert date in email subject line?

    ‏2009-12-02T12:01:34Z  
    • kknb0800
    • ‏2009-12-02T08:52:50Z
    Thanks Alex for your quick reply.

    Unfortunately I have to send stuff out in excel so html is not an option.
    Hi kknb0800

    You can send the body email as HTML but a report attached as Excel with Event Studio.

    AlexPM
  • kknb0800
    kknb0800
    4 Posts

    Re: Is it possible to dynamically insert date in email subject line?

    ‏2009-12-03T14:32:48Z  
    Hi kknb0800

    You can send the body email as HTML but a report attached as Excel with Event Studio.

    AlexPM
    I'll give it a go. Ideally, I would have like it in the subject line but the body will have to do.

    Thanks for your help Alex!
  • SystemAdmin
    SystemAdmin
    15496 Posts

    Re: Is it possible to dynamically insert date in email subject line?

    ‏2009-12-15T14:26:25Z  
    • kknb0800
    • ‏2009-12-03T14:32:48Z
    I'll give it a go. Ideally, I would have like it in the subject line but the body will have to do.

    Thanks for your help Alex!
    Let us know the outcome

    AlexPM
  • SystemAdmin
    SystemAdmin
    15496 Posts

    Re: Is it possible to dynamically insert date in email subject line?

    ‏2013-01-11T18:48:14Z  
    Hi kknb0800

    I guess you are using the "Send by email" option in Cognos. I am afraid you can't add dynamic content to the subject/body of the email.
    If you want, you can add Javacript code into the body (if you send the email as HTML), so you can calculate at least the date, but just in the body.

    Another option is to use Event Studio (the "Send an email" task in Event Studio permits to add dynamic content), but I am not sure if this option would satisfy your requirements.

    Also, the version I am using is Cognos 8.4. I don't know if in Cognos 8.1 you can do the things I explained above.

    Hope this helps

    AlexPM
    Hi Alex,

    I'm currently using Cognos BI 10. I have tried to put in following HTML code in email body but the date is not working and not displayed.

    <html><head></head><body>
    Reports runs on
    <script language="javascript" type="text/javascript">
    var currentTime = new Date();
    var month = currentTime.getMonth() + 1;
    var day = currentTime.getDate();
    var year = currentTime.getFullYear();
    document.write(month + "/" + day + "/" + year);
    </script>
    .
    </body></html>

    Would you or someone please advise?

    Thanks,
    David