public static async Task ShareViaShareFileEmail(ShareFileClient sfClient, Item fileToShare, string recipientEmailAddress) { var sendShare = new ShareSendParams { Emails = new[] { recipientEmailAddress }, Items = new[] {fileToShare.Id}, Subject = "Sample SDK Share", // Allow unlimited downloads MaxDownloads = -1 }; await sfClient.Shares.CreateSend(sendShare).ExecuteAsync(); Console.WriteLine("Sent email to: " + string.Join(", ", sendShare.Emails)); }
/// <summary> /// Deliver Send a File Email /// </summary> /// <remarks> /// Sends an Email to the specified list of addresses, containing a link to the specified Items. /// The default number of expiration days is 30. -1 disables share expiration. /// </remarks> /// <param name="parameters"></param> public IQuery CreateSend(ShareSendParams parameters) { var sfApiQuery = new ShareFile.Api.Client.Requests.Query(Client); sfApiQuery.From("Shares"); sfApiQuery.Action("Send"); sfApiQuery.Body = parameters; sfApiQuery.HttpMethod = "POST"; return sfApiQuery; }