I have a method, to sending meeting URLs
private static string GenerateHttmlTemplate(string roomName, string meetingLink, string userName, DateTime? dateTime = null) {
return $@"
<html>
<head>
<style>
/* CSS for the button */
.button {{
background-color: #5C3E88; /* Button background color */
color: white; /* Text color */
text-decoration: none;
padding: 10px 20px; /* Padding around text */
border-radius: 5px; /* Rounded corners */
display: inline-block;
}}
</style>
</head>
<body>
<p>Here are the meeting details:</p>
<br> <!-- Add a line break -->
<p><strong>Meeting Name:</strong> {roomName}</p>
<p><strong>Teacher Name:</strong> {userName}</p>
<p>Click the button below to join the meeting:</p>
<p><a class='button' href='{meetingLink}'>Join</a></p>
</body>
</html>";
}
public static async Task SendEmail(ObservableCollection<User> users, string roomName, User? user, string meetingLink, DateTime? dateTimeMeeting) {
try {
var smtpClient = new SmtpClient("smtp.gmail.com") {
Port = 587,
Credentials = new System.Net.NetworkCredential(Constants.EMAIL, Constants.APP_PASSWORD),
EnableSsl = true,
DeliveryMethod = SmtpDeliveryMethod.Network
};
foreach(var recipient in users) {
var mail = new MailMessage() {
From = new MailAddress(Constants.EMAIL),
Subject = "DemyIA meeting",
IsBodyHtml = true,
};
var body = GenerateHttmlTemplate(roomName, meetingLink, user!.Name, dateTimeMeeting);
mail.Body = body;
// Add the recipient to the message
mail.To.Add(recipient.Email);
// Send the email asynchronously and await the task
smtpClient.Send(mail);
}
Console.WriteLine("Email sent successfully to the SMTP server.");
} catch(Exception e) {
await Console.Out.WriteLineAsync(e.Message);
}
}
the meeting URL would be something like
<a class="m_2472674493776442577button" href="https://demy-ia.daily.co/m" target="_blank" data-saferedirecturl="https://www.google.com/url?q=https://demy-ia.daily.co/m&source=gmail&ust=1706173440151000&usg=AOvVaw05SUaLpzfkd1rvg8_mcIYi">Join</a>
The beautiful thing about MAUI, is that you can deploy for windows as well
I have this deep link work in Android
https://reccloud.com/u/35c18sw
As you can see, when I receive a link on my email, it will open my app
[IntentFilter([Intent.ActionView],
DataScheme = "https",
DataHost = "demy-ia.daily.co",
DataPathPattern = "/.*",
AutoVerify = true,
Categories = [Intent.CategoryDefault, Intent.CategoryBrowsable])]
public class MainActivity : MauiAppCompatActivity {
protected override void OnNewIntent(Intent? intent) {
base.OnNewIntent(intent);
var res = intent!.Data;
Console.WriteLine(res);
}
I am trying desperately to do the same on windows.
One of the things I can do, is to change the url, to be demy-ai://dedewdew , and whe my application opens, construct the url
there is no other way to do this? on Android it was so easy
By the way How can I test this
demo
https://reccloud.com/u/x189yrw
because I was thinking that I can use that, to build the URL for Windows
Is there any other options?
But if I do this, how I can ake my method send demy-ia://Addyourtestmeetingid only on windows