Is it possible to modify the subject and body of the e-mail sent that contains the scheduled reports? Our report names use Chinese characters and they are not being shown correctly.
Yes, you can modify the subject and body of the e-mail message that contains the scheduled reports.
The "Email Reports Sample" rule populates the "mail.message" field and the "mail.subject" field of the e-mail action with the "message" rule variable. Using @event.get("report/templateName") in the message variable instead of @event.get("report/reportName") may provide a sufficient workaround.
To change the subject or message body you can either add a new rule variable, or you can modify the "message" variable. The "message" variable is used in the subject and the message of the e-mail so if you want different text in the subject and the body of the e-mail message you will want to create new variables, and change the "mail.subject" and "mail.message" action parameters to use the newly defined variables.
If you create a new variable you can start with the definition from the "message" variable and change it to add the new text you want to include. The default "message" variable is defined as follows:
___________________________________________________
if (@event.isSet("report/errorMessage")) {
return @event.get("report/errorMessage");
} else {
return "Report " + @event.get("report/reportName") + " run on " + @event.get("report/dateRun") + " is attached.";
}
___________________________________________________
Following is an example of the format you could use in a new variable:
___________________________________________________
if (@event.isSet("report/errorMessage")) {
return "Report " + @event.get("report/errorMessage");
} else {
return "Report " + @event.get("report/templateName) + " run on " + @event.get("report/dateRun") + " is attached.";
}
___________________________________________________
Following are steps to change the subject of a report e-mail message:
____________________________________________________________
1). Navigate to the Manage Rules page (Administration | Rules & Notifications | Manage Rules).
2). Select the "Email Reports Sample" rule. Type "report" in the "Filter by Rule Name" field and then click on the "Email Reports Sample" link.
3). Select the "Rule Variables" tab.
4). Create a new variable named "subject" starting with the definition of the existing "message" variable.
a). Click on the link for the "message" variable.
b). Change the Name field to contain "subject".
c). Add text for the "subject" variable as follows:
if (@event.isSet("report/errorMessage")) {
return @event.get("report/errorMessage");
} else {
return "Report " + @event.get("report/templateName") + " run on " + @event.get("report/dateRun") + " is attached.";
}
d). Click the "Add" button.
5). Set the mail.subject e-mail action parameter to the "subject" rule variable created in step 4.
a). Click the "Conditions and Actions" tab.
b). Click the "Fire" selection.
c). Click the "Action" tab.
d). Click the "EmailAction" link.
e). Scroll down so that the "mail.sujbect" Action Parameter is visible.
f). Click the link under the "Value" column for the mail.subject action parameter.
g). Select "subject" from the under the "Rule/System Variables" list under the "Action Parameter Editor" window.
h). Click the "Change" button.
i). Click the "Save All" button.
____________________________________________________________
© ALL RIGHTS RESERVED. Feedback Terms of Use Privacy Cookie Preference Center