I need help with scheduling emails using sendinblue. I have working c# code in a Maui project that sends email but I don’t know how to use the scheduleAt option. The code constructs the email and sends it the sendinblue server. Here is a code snippet with those lines I tried with scheduleAt, but the message is sent immediately. I need someone with experience with this.
C#:
string scheduledAt = " DateTime {{params.scheduledAt}}";
SendSmtpEmailAttachment AttachmentContent = new SendSmtpEmailAttachment(AttachmentUrl, Content, AttachmentName);
List<SendSmtpEmailAttachment> Attachment = new List<SendSmtpEmailAttachment>();
Attachment.Add(AttachmentContent);
JObject Headers = new JObject();
Headers.Add("Some-Custom-Name", "unique-id-1234");
long? TemplateId = null;
JObject Params = new JObject();
Params.Add("scheduledAt", "2023-10-14T09:40:00.00-5:00");
Params.Add("HtmlContent", "From mrw");
Params.Add("subject", "Event alert for today");
List<string> Tags = new List<string>();
Tags.Add("mytag");
SendSmtpEmailTo1 smtpEmailTo1 = new SendSmtpEmailTo1(ToEmail, ToName);
List<SendSmtpEmailTo1> To1 = new List<SendSmtpEmailTo1>();
To1.Add(smtpEmailTo1);
Dictionary<string, object> _parmas = new Dictionary<string, object>();
_parmas.Add("params", Params);
SendSmtpEmailReplyTo1 ReplyTo1 = new SendSmtpEmailReplyTo1(ReplyToEmail, ReplyToName);
SendSmtpEmailMessageVersions messageVersion = new SendSmtpEmailMessageVersions(To1, _parmas, null, Cc, ReplyTo1, Subject);
List<SendSmtpEmailMessageVersions> messageVersiopns = new List<SendSmtpEmailMessageVersions>();
messageVersiopns.Add(messageVersion);
try
{
var sendSmtpEmail = new SendSmtpEmail(Email, To, null, Cc, HtmlContent, TextContent, Subject, null, null, null, null, Params, messageVersiopns, Tags);
Last edited by a moderator: