Sendinblue transactional email

Mrw02536

New member
Joined
Oct 13, 2023
Messages
3
Programming Experience
5-10
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:
Where is the documentation for the SendSmtpEmail() constructor? Are you sure that "scheduleAt" is supposed to be in that Params object?

I am asking because the JSON shown in their other documentation below shows it to be outside of "Params":
 
No,I am not sure, but I can’t find anything on c# . It would have to be in parms if the schedule was done at the server.
 
This is the source of the c# code I am using. Notice the mention of scheduleAt without a description of how to include it. It mentions passing parameters so that’s why I unsuccessfully tried parama.add
I know the json also constructs messages with a mention of scheduleAt but there is no help on using the JSON
The c# code works fine.
 
I need someone with experience with this.
C#:

more like you need someone with he requisite level of attention to detail to form a json block

You may find life a lot easier if you use anonymous types to construct json rather than JObjects and dictionaries
 
No,I am not sure, but I can’t find anything on c# . It would have to be in parms if the schedule was done at the server.

But you put it inside a params and then put the params inside another params and then put that inside...

..and the json that SD turned up just doesn't have that deep a nesting of params..
 
Back
Top Bottom