Model for sending an email for an invoice.
Inheritance: DineroEntity
        public static async Task SendEmail(Dinero dinero, string receiverEmail)
        {
            //Creating the tradeoffer
            var tradeoffer = await AddAndGetNewTradeOffer(dinero);

            //Creating mailout model. None of the properties are mandatory.
            var mailoutModel = new MailOut()
            {
                //Timestamp = tradeoffer.TimeStamp,     //Defaults to latest version, but you can use this to ensure the offer has not been changed
                Sender = "*****@*****.**",           //Defaults to organization email
                Receiver = receiverEmail,               //Defaults to contact email. Make sure the contact has an email if you leave this empty.
                Message = "This is a test email from the demo API. To use the default logic for generating email,"      //Defaults to standard message
                          + " just leave this property empty. Here is a downlaod link to your tradeoffer: [link-to-pdf]"
            };

            await dinero.TradeOffers.SendEmailAsync(tradeoffer.Guid, mailoutModel);
            Console.WriteLine("Email was send to: " + receiverEmail);
        }
        public static async Task SendEmail(Dinero dinero, string receiverEmail)
        {
            //The CreditNote need to be booked
            var creditNote = await AddAndBookCreditNote(dinero);
            var mailoutModel = new MailOut()
            {
                Timestamp = creditNote.TimeStamp,
                Sender = "*****@*****.**",
                Receiver = receiverEmail,
                Message = "This is a test email from the demo API. To use the default logic for generating email,"
                +" just leave this property empty. Here is a downlaod link to your CreditNote: [link-to-pdf]"
            };

            await dinero.Sales.CreditNotes.SendEmailAsync(creditNote.Guid,mailoutModel);
            Console.WriteLine("Email was send to: " + receiverEmail);
        }
        public static async Task SendPreReminderEmail(Dinero dinero, string receiverEmail)
        {
            Console.WriteLine("Gets a list of overdue invoices, and send a reminder for the first.");
            var overdueInvoices =dinero.Sales.Invoices.GetList(statusFilter: "Overdue");
            var invoice = overdueInvoices.Collection.FirstOrDefault();
            if (invoice == null)
            {
                Console.WriteLine("No overdue invoices found on selected organization. Not possible to send pre-reminder.");
                return;
            }

            var fullInvoice = dinero.Sales.Invoices.Get(invoice.Guid);

            var mailoutModel = new MailOut()
            {
                Timestamp = fullInvoice.TimeStamp,
                Sender = "*****@*****.**",
                Receiver = receiverEmail,
                Message = "This is a test email from the demo API. To use the default logic for generating email,"
                + " just leave this property empty. Here is a download link to your invoice: [link-to-pdf]"
            };

            await dinero.Sales.Invoices.SendPreReminderEmailAsync(invoice.Guid, mailoutModel);
            Console.WriteLine("Pre reminder email was send to: " + receiverEmail);
        }
 /// <summary>
 /// Send an email with a link to the tradeoffer
 /// </summary>
 /// <param name="guid">Guid of the tradeoffer</param>
 /// <param name="mailoutModel">Model with data to send email of the tradeoffer</param>
 /// <returns></returns>
 public Task SendEmailAsync(Guid guid,MailOut mailoutModel = null)
 {
     return PostAsyncWithGuid<EmptyDineroResult>(guid, mailoutModel, "email");
 }
 /// <summary>
 /// Send an email with a link to the tradeoffer
 /// </summary>
 /// <param name="guid">Guid of the tradeoffer</param>
 /// <param name="mailoutModel">Model with data to send email of the tradeoffer</param>
 /// <returns></returns>
 public void SendEmail(Guid guid, MailOut mailoutModel = null)
 {
     TaskHelper.ExecuteSync(() => SendEmailAsync(guid,mailoutModel));
 }