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); }
public virtual void TestSendSheet() { server.setResponseBody("../../../TestSDK/resources/sendEmails.json"); string[] emailAddress = new string[] { "*****@*****.**" }; SheetEmail email = new SheetEmail(); email.Format = SheetEmailFormat.PDF; FormatDetails format = new FormatDetails(); format.PaperSize = PaperSize.A0; email.FormatDetails = format; email.To = new List <string>(emailAddress); sheetResource.SendSheet(1234L, email); }
/// <summary> /// <para>Send a sheet as a PDF attachment via Email To the designated recipients.</para> /// /// <para>It mirrors To the following Smartsheet REST API method: POST /sheets/{sheetId}/emails</para> /// </summary> /// <param name="sheetId"> the sheetId </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 SendSheet(long sheetId, SheetEmail email) { this.CreateResource <SheetEmail>("sheets/" + sheetId + "/emails", typeof(SheetEmail), email); }
/// <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); }