/// <summary>
 /// Initializes a new instance of the <see cref="SendSmtpEmail" /> class.
 /// </summary>
 /// <param name="sender">sender.</param>
 /// <param name="to">Mandatory if messageVersions are not passed, ignored if messageVersions are passed. List of email addresses and names (optional) of the recipients. For example, [{&quot;name&quot;:&quot;Jimmy&quot;, &quot;email&quot;:&quot;[email protected]&quot;}, {&quot;name&quot;:&quot;Joe&quot;, &quot;email&quot;:&quot;[email protected]&quot;}].</param>
 /// <param name="bcc">List of email addresses and names (optional) of the recipients in bcc.</param>
 /// <param name="cc">List of email addresses and names (optional) of the recipients in cc.</param>
 /// <param name="htmlContent">HTML body of the message ( Mandatory if &#39;templateId&#39; is not passed, ignored if &#39;templateId&#39; is passed ).</param>
 /// <param name="textContent">Plain Text body of the message ( Ignored if &#39;templateId&#39; is passed ).</param>
 /// <param name="subject">Subject of the message. Mandatory if &#39;templateId&#39; is not passed.</param>
 /// <param name="replyTo">replyTo.</param>
 /// <param name="attachment">Pass the absolute URL (no local file) or the base64 content of the attachment along with the attachment name (Mandatory if attachment content is passed). For example, &#x60;[{&quot;url&quot;:&quot;https://attachment.domain.com/myAttachmentFromUrl.jpg&quot;, &quot;name&quot;:&quot;myAttachmentFromUrl.jpg&quot;}, {&quot;content&quot;:&quot;base64 example content&quot;, &quot;name&quot;:&quot;myAttachmentFromBase64.jpg&quot;}]&#x60;. Allowed extensions for attachment file: xlsx, xls, ods, docx, docm, doc, csv, pdf, txt, gif, jpg, jpeg, png, tif, tiff, rtf, bmp, cgm, css, shtml, html, htm, zip, xml, ppt, pptx, tar, ez, ics, mobi, msg, pub, eps, odt, mp3, m4a, m4v, wma, ogg, flac, wav, aif, aifc, aiff, mp4, mov, avi, mkv, mpeg, mpg and wmv ( If &#39;templateId&#39; is passed and is in New Template Language format then both attachment url and content are accepted. If template is in Old template Language format, then &#39;attachment&#39; is ignored ).</param>
 /// <param name="headers">Pass the set of custom headers (not the standard headers) that shall be sent along the mail headers in the original email. &#39;sender.ip&#39; header can be set (only for dedicated ip users) to mention the IP to be used for sending transactional emails. Headers are allowed in &#x60;This-Case-Only&#x60; (i.e. words separated by hyphen with first letter of each word in capital letter), they will be converted to such case styling if not in this format in the request payload. For example, &#x60;{&quot;sender.ip&quot;:&quot;1.2.3.4&quot;, &quot;X-Mailin-custom&quot;:&quot;some_custom_header&quot;}&#x60;..</param>
 /// <param name="templateId">Id of the template. Mandatory if messageVersions are passed.</param>
 /// <param name="_params">Pass the set of attributes to customize the template. For example, {&quot;FNAME&quot;:&quot;Joe&quot;, &quot;LNAME&quot;:&quot;Doe&quot;}. It&#39;s considered only if template is in New Template Language format..</param>
 /// <param name="messageVersions">You can customize and send out multiple versions of a templateId. Some global parameters such as **to(mandatory), bcc, cc, replyTo, subject** can also be customized specific to each version. The size of individual params in all the messageVersions shall not exceed 100 KB limit and that of cumulative params shall not exceed 1000 KB. This feature is currently in its beta version. You can follow this **step-by-step guide** on how to use **messageVersions** to batch send emails - https://developers.sendinblue.com/docs/batch-send-transactional-emails.</param>
 /// <param name="tags">Tag your emails to find them more easily.</param>
 public SendSmtpEmail(SendSmtpEmailSender sender = default(SendSmtpEmailSender), List <SendSmtpEmailTo> to = default(List <SendSmtpEmailTo>), List <SendSmtpEmailBcc> bcc = default(List <SendSmtpEmailBcc>), List <SendSmtpEmailCc> cc = default(List <SendSmtpEmailCc>), string htmlContent = default(string), string textContent = default(string), string subject = default(string), SendSmtpEmailReplyTo replyTo = default(SendSmtpEmailReplyTo), List <SendSmtpEmailAttachment> attachment = default(List <SendSmtpEmailAttachment>), Object headers = default(Object), long?templateId = default(long?), Object _params = default(Object), List <SendSmtpEmailMessageVersions> messageVersions = default(List <SendSmtpEmailMessageVersions>), List <string> tags = default(List <string>))
 {
     this.Sender          = sender;
     this.To              = to;
     this.Bcc             = bcc;
     this.Cc              = cc;
     this.HtmlContent     = htmlContent;
     this.TextContent     = textContent;
     this.Subject         = subject;
     this.ReplyTo         = replyTo;
     this.Attachment      = attachment;
     this.Headers         = headers;
     this.TemplateId      = templateId;
     this.Params          = _params;
     this.MessageVersions = messageVersions;
     this.Tags            = tags;
 }
Exemple #2
0
 /// <summary>
 /// Initializes a new instance of the <see cref="SendSmtpEmail" /> class.
 /// </summary>
 /// <param name="sender">sender.</param>
 /// <param name="to">List of email addresses and names (optional) of the recipients. For example, [{&quot;name&quot;:&quot;Jimmy&quot;, &quot;email&quot;:&quot;[email protected]&quot;}, {&quot;name&quot;:&quot;Joe&quot;, &quot;email&quot;:&quot;[email protected]&quot;}] (required).</param>
 /// <param name="bcc">List of email addresses and names (optional) of the recipients in bcc.</param>
 /// <param name="cc">List of email addresses and names (optional) of the recipients in cc.</param>
 /// <param name="htmlContent">HTML body of the message ( Mandatory if &#39;templateId&#39; is not passed, ignored if &#39;templateId&#39; is passed ).</param>
 /// <param name="textContent">Plain Text body of the message ( Ignored if &#39;templateId&#39; is passed ).</param>
 /// <param name="subject">Subject of the message. Mandatory if &#39;templateId&#39; is not passed.</param>
 /// <param name="replyTo">replyTo.</param>
 /// <param name="attachment">Pass the absolute URL (no local file) or the base64 content of the attachment along with the attachment name (Mandatory if attachment content is passed). For example, &#x60;[{&quot;url&quot;:&quot;https://attachment.domain.com/myAttachmentFromUrl.jpg&quot;, &quot;name&quot;:&quot;myAttachmentFromUrl.jpg&quot;}, {&quot;content&quot;:&quot;base64 example content&quot;, &quot;name&quot;:&quot;myAttachmentFromBase64.jpg&quot;}]&#x60;. Allowed extensions for attachment file: xlsx, xls, ods, docx, docm, doc, csv, pdf, txt, gif, jpg, jpeg, png, tif, tiff, rtf, bmp, cgm, css, shtml, html, htm, zip, xml, ppt, pptx, tar, ez, ics, mobi, msg, pub, eps, odt, mp3, m4a, m4v, wma, ogg, flac, wav, aif, aifc, aiff, mp4, mov, avi, mkv, mpeg, mpg and wmv ( If &#39;templateId&#39; is passed and is in New Template Language format then both attachment url and content are accepted. If template is in Old template Language format, then &#39;attachment&#39; is ignored ).</param>
 /// <param name="headers">Pass the set of custom headers (not the standard headers) that shall be sent along the mail headers in the original email. &#39;sender.ip&#39; header can be set (only for dedicated ip users) to mention the IP to be used for sending transactional emails. Headers are allowed in &#x60;This-Case-Only&#x60; (i.e. words separated by hyphen with first letter of each word in capital letter), they will be converted to such case styling if not in this format in the request payload. For example, &#x60;{&quot;sender.ip&quot;:&quot;1.2.3.4&quot;, &quot;X-Mailin-custom&quot;:&quot;some_custom_header&quot;}&#x60;..</param>
 /// <param name="templateId">Id of the template.</param>
 /// <param name="_params">Pass the set of attributes to customize the template. For example, {&quot;FNAME&quot;:&quot;Joe&quot;, &quot;LNAME&quot;:&quot;Doe&quot;}. It&#39;s considered only if template is in New Template Language format..</param>
 /// <param name="tags">Tag your emails to find them more easily.</param>
 public SendSmtpEmail(SendSmtpEmailSender sender = default(SendSmtpEmailSender), List <SendSmtpEmailTo> to = default(List <SendSmtpEmailTo>), List <SendSmtpEmailBcc> bcc = default(List <SendSmtpEmailBcc>), List <SendSmtpEmailCc> cc = default(List <SendSmtpEmailCc>), string htmlContent = default(string), string textContent = default(string), string subject = default(string), SendSmtpEmailReplyTo replyTo = default(SendSmtpEmailReplyTo), List <SendSmtpEmailAttachment> attachment = default(List <SendSmtpEmailAttachment>), Object headers = default(Object), long?templateId = default(long?), Object _params = default(Object), List <string> tags = default(List <string>))
 {
     // to ensure "to" is required (not null)
     if (to == null)
     {
         throw new InvalidDataException("to is a required property for SendSmtpEmail and cannot be null");
     }
     else
     {
         this.To = to;
     }
     this.Sender      = sender;
     this.Bcc         = bcc;
     this.Cc          = cc;
     this.HtmlContent = htmlContent;
     this.TextContent = textContent;
     this.Subject     = subject;
     this.ReplyTo     = replyTo;
     this.Attachment  = attachment;
     this.Headers     = headers;
     this.TemplateId  = templateId;
     this.Params      = _params;
     this.Tags        = tags;
 }