public bool SendEmail(string invoiceId, InvoiceEmail email) { var request = CreateBasicRequest(Method.POST, "/{id}/send_email"); request.RequestFormat = DataFormat.Json; request.AddUrlSegment("id", invoiceId); request.AddBody(new InvoiceEmailWrapper() { invoice = email }); var response = Client.Execute(request); if (response != null) { return(response.StatusCode == System.Net.HttpStatusCode.OK); } return(false); }
public InvoiceEmailWrapper() { invoice = new InvoiceEmail(); }
internal static InvoiceEmailWrapper Wrap(this InvoiceEmail email) { return(new InvoiceEmailWrapper { Invoice = email }); }
public static Task CreateInvoiceEmail(this FreeAgentClient client, int invoiceId, InvoiceEmail email) { return(client.Execute(c => c.EmailInvoice(client.Configuration.CurrentHeader, invoiceId, email.Wrap()))); }
public InvoiceEmailWrapper() { invoice = new InvoiceEmail (); }