|
|
|
This library generates a report from the GetTask3 application and can optionally send it via email.
Install the package via NuGet Package Manager:
Install-Package ProductivityTools.GetTask3.ReportingOr via the .NET CLI:
dotnet add package ProductivityTools.GetTask3.ReportingThe main component of the library is the ReportGenerator class. To use it, you need to provide the GetTask3 API URL, a Firebase Web API Key, and a Gmail password for the sending account.
using ProductivityTools.GetTask3.Reporting;
using System;
using System.Threading.Tasks;
public class Program
{
public static async Task Main(string[] args)
{
// Replace with your actual credentials and URL
string url = "https://your-gettask3-api-url.com";
string firebaseWebApiKey = "your_firebase_web_api_key";
string gmailPassword = "your_gmail_password";
// Create an instance of the report generator
var reportGenerator = new ReportGenerator(url, firebaseWebApiKey, gmailPassword);
// Define a logger action (e.g., writing to the console)
Action<string> consoleLog = (message) => Console.WriteLine(message);
// Generate the report. Set sendReport to true to email it.
// Note: The recipient is currently configured within the library logic.
bool sendReport = false;
string reportContent = await reportGenerator.GenerateReport(consoleLog, sendReport);
Console.WriteLine("\n--- Generated Report ---");
Console.WriteLine(reportContent);
}
}ReportGenerator(string url, string firebaseWebApiKey, string gmailPassword): The constructor requires the API endpoint, Firebase key, and the password for the Gmail account used for sending emails.GenerateReport(Action<string> consoleLog, bool sendReport): This asynchronous method fetches the data, generates the report string, and, ifsendReportistrue, emails the report. It takes a logger action to provide status updates.
Contributions are welcome. Please open an issue or submit a pull request on the GitHub repository.
This project is licensed under the MIT License. See the LICENSE file for details.


