You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/SendGrid/Helpers/Mail/SendGridMessage.cs
+50Lines changed: 50 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -138,6 +138,12 @@ public class SendGridMessage
138
138
[JsonProperty(PropertyName="reply_to")]
139
139
publicEmailAddressReplyTo{get;set;}
140
140
141
+
/// <summary>
142
+
/// Gets or sets a list of objects of email objects containing the email address and name of the individuals who should receive responses to your email.
/// <param name="email">Specify the recipient's email.</param>
331
+
/// <param name="name">Specify the recipient's name.</param>
332
+
/// <exception cref="System.ArgumentNullException">Thrown when the email parameter is null or whitespace</exception>
333
+
publicvoidAddReplyTo(stringemail,stringname=null)
334
+
{
335
+
if(string.IsNullOrWhiteSpace(email))
336
+
thrownewArgumentNullException("email");
337
+
338
+
this.AddReplyTo(newEmailAddress(email,name));
339
+
}
340
+
341
+
/// <summary>
342
+
/// Add a reply-to email.
343
+
/// </summary>
344
+
/// <param name="email">An email recipient that may contain the recipient’s name, but must always contain the recipient’s email.</param>
345
+
/// <exception cref="System.ArgumentNullException">Thrown when the email parameter is null</exception>
346
+
publicvoidAddReplyTo(EmailAddressemail)
347
+
{
348
+
if(email==null)
349
+
thrownewArgumentNullException("email");
350
+
351
+
AddReplyTos(newList<EmailAddress>{email});
352
+
}
353
+
354
+
/// <summary>
355
+
/// Add reply-to recipients.
356
+
/// </summary>
357
+
/// <param name="emails">A list of reply-to recipients. Each email object within this array may contain the recipient’s name, but must always contain the recipient’s email.</param>
358
+
/// <exception cref="System.ArgumentNullException">Thrown when the emails parameter is null</exception>
359
+
/// <exception cref="System.InvalidOperationException">Thrown when the emails parameter is empty</exception>
360
+
publicvoidAddReplyTos(List<EmailAddress>emails)
361
+
{
362
+
if(emails==null)
363
+
thrownewArgumentNullException("emails");
364
+
if(emails.Count==0)
365
+
thrownewInvalidOperationException("Sequence contains no elements");
/// You may not include more than 100 substitutions per personalization object, and the total collective size of your substitutions may not exceed 10,000 bytes per personalization object.
0 commit comments