/// <summary> /// <para>Send a report as a PDF attachment via Email To the designated recipients.</para> /// /// <para>It mirrors To the following Smartsheet REST API method: POST /reports/{reportId}/emails</para> /// </summary> /// <param name="reportId"> the reportId </param> /// <param name="email"> the Email </param> /// <exception cref="System.InvalidOperationException"> if any argument is null or empty string </exception> /// <exception cref="InvalidRequestException"> if there is any problem with the REST API request </exception> /// <exception cref="AuthorizationException"> if there is any problem with the REST API authorization (access token) </exception> /// <exception cref="ResourceNotFoundException"> if the resource cannot be found </exception> /// <exception cref="ServiceUnavailableException"> if the REST API service is not available (possibly due To rate limiting) </exception> /// <exception cref="SmartsheetException"> if there is any other error during the operation </exception> public virtual void SendReport(long reportId, SheetEmail email) { this.CreateResource<SheetEmail>("reports/" + reportId + "/emails", typeof(SheetEmail), email); }
private static void SendSheet(SmartsheetClient smartsheet, long sheetId) { SheetEmail sheetEmail = new SheetEmail { SendTo = new Recipient[] { new Recipient { Email = "*****@*****.**" } }, Subject = "Subject", Format = SheetEmailFormat.PDF }; smartsheet.SheetResources.SendSheet(sheetId, sheetEmail); }