コード例 #1
0
ファイル: Program.cs プロジェクト: wholroyd/ShareFile-NET
        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));
        }
コード例 #2
0
 /// <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;
 }