Date variables in email subject

Manuel16
Tera Contributor

Hello community,

 

Please can you tell me how it is possible to get the current month and year in an email subject?

Background, we have a scheduled report, which is sent monthly via email. This email contains excel files with data from the last month. Currently our monthly email has always the same fixed subject. It would be fine if we can add Month and Year in the Subject.

It would also be great, if the attached Excel could have those variables (month and date) in the file name. Currently the customer always have to add the date information, when he/she saves the excel.

 

thanks

kind regards,

Manuel

6 REPLIES 6

Murali Prathipa
Tera Expert

You can use the email script to populate subject, something like email.subject = "current month calculated from script"

Also, while generating the attachment you can use the similar script to get the current month & date and append to the title. 

Sai Kumar B
Mega Sage
Mega Sage

@Murali Prathipati 

You can set the notification subject from the email script

1. create mailscript and add below code:

Email script name: setsubjectDate

var date =  gs.nowDateTime() ; // To get current date and time email
.setSubject("Date "+date);

2.) Call the email script in notification body as below

${mail_script:setSubjectDate}

@sai kumar @sai kumar @sai kumar @sai kumar 

@Murali Prathipati 

 

Please excuse that I have linked four times sai kumar, but I wasn´t sure which is the correct one.

Please can you tell me which mail notification I´ve to use?

I want the date variable in one of my own created sheduled report. Which template or notification is behind such scheduled report?

Or is it anyhow possible to add the script directly into the scheduled report?

Do you want the current date in the subject of an email or in a report?