Hello!
I'm trying to create a basic script that emails a DataMiner dashboard to a non-specfic person.
When I execute the script, I recive an email with the correct name and message however I don't see the dashboard that I'm trying to link to.
I followed the PrepareMailReport and SendReport documentation.
I have included below both the script and the results of it. The results do not change whether the dashboard name is a valid dahboard or not.
Any help on this would be much appreactiated!

Can you confirm if the "report name" contains the full name of the dashboard (including any parent folder of the dashboard with the name, separated with "/")?
Hi Amber,
In Automation scripts, you can define an action called Email, which should also work.
Example:

Hi Matthias! I am aware of this feature however, when doing it via the Actions method you cannot put a varible/placeholder in the "To" section.
And therefore I have to do it via C# so I can make the recipient dynamic instead of fixed.
So, do you know if there is a c# solution for including reports/dashboards in the email?

I also need what report to send to be dynamic and that will be defined in Visio Execute Shape Data.

I'm not familiar with that part, but I believe I can direct you to this same question: https://community.dataminer.services/question/how-to-send-a-by-code-created-dashboard-as-a-report-via-email/

Hi Amber, This is an additional notification to tell you I edited the previous link.
Correct link is https://community.dataminer.services/question/how-to-send-a-by-code-created-dashboard-as-a-report-via-email/
The code in text form:
namespace SendEmailReportScript_2
{
using System;
using Skyline.DataMiner.Automation;
/// <summary>
/// Represents a DataMiner Automation script.
/// </summary>
public class Script
{
/// <summary>
/// The script entry point.
/// </summary>
public void Run(IEngine engine)
{
if (engine is null)
{
throw new ArgumentNullException(nameof(engine));
}
ScriptParam myReportParam = engine.GetScriptParam("Report Name");
ScriptParam myEmailParam = engine.GetScriptParam("Email Address");
MailReportOptions reportOptions = engine.PrepareMailReport(myReportParam.Value);
EmailOptions emailOptions = new EmailOptions
{
Title = $"Statistics Report For {myReportParam.Value}",
Message = "Report has been generated",
TO = myEmailParam.Value,
SendAsPlainText = true
};
reportOptions.SetMailOptions(emailOptions);
engine.SendEmail(emailOptions);
}
}
}